diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-04-04 23:06:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-04-04 23:06:32 +0300 |
commit | 24cdc3eb7a613344c655560c0ef43f8611acdc45 (patch) | |
tree | ad84685c3ea7d31998862dd98cc4d2814d2e1558 /src | |
parent | c7855b90048daf581fcbbf1ebaa31f3248fa74f4 (diff) | |
download | manaplus-24cdc3eb7a613344c655560c0ef43f8611acdc45.tar.gz manaplus-24cdc3eb7a613344c655560c0ef43f8611acdc45.tar.bz2 manaplus-24cdc3eb7a613344c655560c0ef43f8611acdc45.tar.xz manaplus-24cdc3eb7a613344c655560c0ef43f8611acdc45.zip |
While changing focus. always focus new control and after unfocus old control.s20180406
Before this commit in one place all controls can be without focus before
set new focus.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/focushandler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/focushandler.cpp b/src/gui/focushandler.cpp index 306e279ec..5a84b3dd3 100644 --- a/src/gui/focushandler.cpp +++ b/src/gui/focushandler.cpp @@ -381,14 +381,14 @@ void FocusHandler::requestFocus(const Widget *const widget) { mFocusedWidget = mWidgets.at(toBeFocusedIndex); + Event focusEvent(mFocusedWidget); + distributeFocusGainedEvent(focusEvent); + if (oldFocused != nullptr) { - Event focusEvent(oldFocused); - distributeFocusLostEvent(focusEvent); + Event oldFocusEvent(oldFocused); + distributeFocusLostEvent(oldFocusEvent); } - - Event focusEvent(mWidgets.at(toBeFocusedIndex)); - distributeFocusGainedEvent(focusEvent); } } |