diff options
author | Socapex <philippe_groarke@yahoo.ca> | 2013-01-19 21:02:01 -0500 |
---|---|---|
committer | Socapex <philippe_groarke@yahoo.ca> | 2013-01-19 21:02:01 -0500 |
commit | df606ace309acaf0c78f52e1f98eabed6c844ae2 (patch) | |
tree | d9799b0e4a507d9eacbbafc1755eecea03f0b373 /src/gui/widgets/popuplist.cpp | |
parent | d0169223b889a115b486e974e5b287c3ccb00d85 (diff) | |
parent | 678d4e70999ade5a36862039875aa5564291d09d (diff) | |
download | plus-df606ace309acaf0c78f52e1f98eabed6c844ae2.tar.gz plus-df606ace309acaf0c78f52e1f98eabed6c844ae2.tar.bz2 plus-df606ace309acaf0c78f52e1f98eabed6c844ae2.tar.xz plus-df606ace309acaf0c78f52e1f98eabed6c844ae2.zip |
Merge remote-tracking branch 'upstream/master' into osx
Diffstat (limited to 'src/gui/widgets/popuplist.cpp')
-rw-r--r-- | src/gui/widgets/popuplist.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp index 80fd12e85..ca9ef2c7d 100644 --- a/src/gui/widgets/popuplist.cpp +++ b/src/gui/widgets/popuplist.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2012 The ManaPlus Developers + * Copyright (C) 2011-2013 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -32,14 +32,15 @@ PopupList::PopupList(DropDown *const widget, gcn::ListModel *const listModel, - bool extended): + bool extended, bool modal): Popup("PopupList", "popuplist.xml"), gcn::FocusListener(), mListModel(listModel), mListBox(extended ? new ExtendedListBox(widget, listModel, 0) : new ListBox(widget, listModel)), mScrollArea(new ScrollArea(mListBox, false)), - mDropDown(widget) + mDropDown(widget), + mModal(modal) { setFocusable(true); @@ -79,6 +80,8 @@ void PopupList::show(int x, int y) setPosition(x, y); setVisible(true); requestMoveToTop(); + if (mModal) + requestModalFocus(); } void PopupList::widgetResized(const gcn::Event &event) @@ -124,6 +127,8 @@ void PopupList::mousePressed(gcn::MouseEvent& mouseEvent A_UNUSED) if (mDropDown) mDropDown->updateSelection(); setVisible(false); + if (mModal) + releaseModalFocus(); } void PopupList::focusGained(const gcn::Event& event A_UNUSED) @@ -138,6 +143,8 @@ void PopupList::focusGained(const gcn::Event& event A_UNUSED) if (mDropDown) mDropDown->updateSelection(); setVisible(false); + if (mModal) + releaseModalFocus(); } void PopupList::focusLost(const gcn::Event& event A_UNUSED) |