[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands
The proposal to merge lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands has been updated. Status: Needs review => Merged For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1627374-chat-input/+merge/345457 -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands
OK, let's do that. New bug: https://bugs.launchpad.net/widelands/+bug/1772076 @bunnybot merge -- https://code.launchpad.net/~widelands-dev/widelands/bug-1627374-chat-input/+merge/345457 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands
Hm, using keys as Pos1 or stored locations does not fix the arrow keys. Opening and/or closing some other windows per hotkey or mouse seems to fix it in some cases. But I don't notice any useful pattern there. Perhaps something wrong with gaining/releasing the (keyboard) focus somewhere? Maybe just get this in and open a bug report for the arrow keys. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1627374-chat-input/+merge/345457 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands
The problem here is that we have a textinput event rather than a key event - if you press a hotkey first, the arrows will suddenly start working. I have no idea why yet. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1627374-chat-input/+merge/345457 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands
Continuous integration builds have changed state: Travis build 3522. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/379561820. Appveyor build 3327. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1627374_chat_input-3327. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1627374-chat-input/+merge/345457 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands
- Arrow keys still do not work I can't reproduce this one - what exactly are you doing to trigger this? - Enter key does nothing on first press, closes window on second press Fixed, does nothing now -- https://code.launchpad.net/~widelands-dev/widelands/bug-1627374-chat-input/+merge/345457 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands
I am not quite convinced of this branch, since it only solves the problem partially. In trunk: - Hotkey like Ctrl+1 and "s" do not work - Arrow keys do not work - Enter key closes the minimized window In this branch: - Hotkeys work - Arrow keys still do not work - Enter key does nothing on first press, closes window on second press The working hotkeys are nice, additionally working arrow keys would be even better. And the behavior of the enter key is quite strange, no idea where that is coming from. A suggestion independent of the current behavior: Maximize chat window on enter key when currently minimized instead of closing it? For what it's worth: Code is looking good. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1627374-chat-input/+merge/345457 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands. Commit message: Remove focus from editbox in gamechatpanel when it minimizes Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1627374 in widelands: "Chat window is still focused when minimized" https://bugs.launchpad.net/widelands/+bug/1627374 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1627374-chat-input/+merge/345457 -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1627374-chat-input into lp:widelands. === modified file 'src/ui_basic/window.h' --- src/ui_basic/window.h 2018-04-07 16:59:00 + +++ src/ui_basic/window.h 2018-05-12 08:29:49 + @@ -80,8 +80,8 @@ bool is_minimal() const { return is_minimal_; } - void restore(); - void minimize(); + virtual void restore(); + virtual void minimize(); bool is_snap_target() const override { return true; } === modified file 'src/wui/game_chat_menu.cc' --- src/wui/game_chat_menu.cc 2018-04-07 16:59:00 + +++ src/wui/game_chat_menu.cc 2018-05-12 08:29:49 + @@ -34,11 +34,11 @@ ChatProvider& chat, const std::string& title) : UI::UniqueWindow(parent, "chat", , 440, 235, title), - chat_(this, 5, 5, get_inner_w() - 10, get_inner_h() - 10, chat) { - if (get_usedefaultpos()) + chat_(this, 5, 5, get_inner_w() - 10, get_inner_h() - 10, chat), close_on_send_(false) { + if (get_usedefaultpos()) { center_to_parent(); - - close_on_send_ = false; + } + set_can_focus(true); chat_.sent.connect(boost::bind(::acknowledge, this)); chat_.aborted.connect(boost::bind(::acknowledge, this)); @@ -63,7 +63,18 @@ close_on_send_ = close_on_send; } +void GameChatMenu::restore() { + Window::restore(); + chat_.focus_edit(); +} + +void GameChatMenu::minimize() { + Window::minimize(); + chat_.unfocus_edit(); +} + void GameChatMenu::acknowledge() { - if (close_on_send_) + if (close_on_send_) { die(); + } } === modified file 'src/wui/game_chat_menu.h' --- src/wui/game_chat_menu.h 2018-04-07 16:59:00 + +++ src/wui/game_chat_menu.h 2018-05-12 08:29:49 + @@ -49,6 +49,9 @@ private: GameChatMenu(UI::Panel*, UI::UniqueWindow::Registry&, ChatProvider&, const std::string& title); + + void restore() override; + void minimize() override; void acknowledge(); GameChatPanel chat_; bool close_on_send_; === modified file 'src/wui/gamechatpanel.cc' --- src/wui/gamechatpanel.cc 2018-05-02 19:26:52 + +++ src/wui/gamechatpanel.cc 2018-05-12 08:29:49 + @@ -93,9 +93,18 @@ * Put the focus on the message input panel. */ void GameChatPanel::focus_edit() { + editbox.set_can_focus(true); editbox.focus(); } +/** + * Remove the focus from the message input panel. + */ +void GameChatPanel::unfocus_edit() { + editbox.set_can_focus(false); +} + + void GameChatPanel::key_enter() { const std::string& str = editbox.text(); === modified file 'src/wui/gamechatpanel.h' --- src/wui/gamechatpanel.h 2018-04-21 14:15:48 + +++ src/wui/gamechatpanel.h 2018-05-12 08:29:49 + @@ -49,6 +49,7 @@ } void focus_edit(); + void unfocus_edit(); private: void recalculate(); ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp