From bc9712cfb34a891a64bd28b76df0f9f4e5d01513 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 17 Jan 2013 18:45:21 +0300 Subject: Fix server type dropdown in new server dialog. --- src/gui/widgets/popuplist.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/gui/widgets/popuplist.cpp') 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) -- cgit v1.2.3-70-g09d2