summaryrefslogtreecommitdiff
path: root/src/gui/widgets/popuplist.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-17 18:45:21 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-17 18:45:21 +0300
commitbc9712cfb34a891a64bd28b76df0f9f4e5d01513 (patch)
treef8687ee78d213e5a90572fc06b642d24f9ad28de /src/gui/widgets/popuplist.cpp
parent37c0c88a7b96919470a0abed8e17b3a0352ca49d (diff)
downloadmv-bc9712cfb34a891a64bd28b76df0f9f4e5d01513.tar.gz
mv-bc9712cfb34a891a64bd28b76df0f9f4e5d01513.tar.bz2
mv-bc9712cfb34a891a64bd28b76df0f9f4e5d01513.tar.xz
mv-bc9712cfb34a891a64bd28b76df0f9f4e5d01513.zip
Fix server type dropdown in new server dialog.
Diffstat (limited to 'src/gui/widgets/popuplist.cpp')
-rw-r--r--src/gui/widgets/popuplist.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp
index 22b479a20..ca9ef2c7d 100644
--- a/src/gui/widgets/popuplist.cpp
+++ b/src/gui/widgets/popuplist.cpp
@@ -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)