summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorTametomo <irarice@gmail.com>2009-06-24 08:46:46 -0600
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-14 21:33:31 +0100
commitc8ac922256709e51674a67195f9bdc270f9fc261 (patch)
treece611862d8785107102de5e99d0510eca4ded5f7 /src/gui/widgets
parent5000d1d38f18cbc0008cac2e73845bc618056f6e (diff)
downloadmana-client-c8ac922256709e51674a67195f9bdc270f9fc261.tar.gz
mana-client-c8ac922256709e51674a67195f9bdc270f9fc261.tar.bz2
mana-client-c8ac922256709e51674a67195f9bdc270f9fc261.tar.xz
mana-client-c8ac922256709e51674a67195f9bdc270f9fc261.zip
Release modal mouse focus in DropDowns when focus is lost. If not
released, this can cause the user to think that the client has frozen up when dialogs such as the quit dialog take modal focus. Signed-off-by: Tametomo <irarice@gmail.com>
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/dropdown.cpp6
-rw-r--r--src/gui/widgets/dropdown.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index c45dc226..8b36f19f 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -234,6 +234,12 @@ void DropDown::keyPressed(gcn::KeyEvent& keyEvent)
}
}
+void DropDown::focusLost(const gcn::Event& event)
+{
+ gcn::DropDown::focusLost(event);
+ releaseModalMouseInputFocus();
+}
+
void DropDown::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent)
{
setSelected(getSelected() - 1);
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index 568e20a5..15c52767 100644
--- a/src/gui/widgets/dropdown.h
+++ b/src/gui/widgets/dropdown.h
@@ -58,6 +58,10 @@ class DropDown : public gcn::DropDown
void drawFrame(gcn::Graphics *graphics);
+ // Inherited from FocusListener
+
+ void focusLost(const gcn::Event& event);
+
// Inherited from KeyListener
void keyPressed(gcn::KeyEvent& keyEvent);