summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-04 23:06:32 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-04 23:06:32 +0300
commit24cdc3eb7a613344c655560c0ef43f8611acdc45 (patch)
treead84685c3ea7d31998862dd98cc4d2814d2e1558
parentc7855b90048daf581fcbbf1ebaa31f3248fa74f4 (diff)
downloadplus-24cdc3eb7a613344c655560c0ef43f8611acdc45.tar.gz
plus-24cdc3eb7a613344c655560c0ef43f8611acdc45.tar.bz2
plus-24cdc3eb7a613344c655560c0ef43f8611acdc45.tar.xz
plus-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.
-rw-r--r--src/gui/focushandler.cpp10
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);
}
}