summaryrefslogtreecommitdiff
path: root/src/gui/widgets/popuplist.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-28 00:55:13 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-28 00:55:13 +0300
commit01a0e4b658241cc3dbd8a5d11d34a6de48dab159 (patch)
tree37294c079b9a05768b7380f7595784eb73485769 /src/gui/widgets/popuplist.cpp
parent072b727ae4d072d6c84f3331d78ca5a2ac76d271 (diff)
downloadplus-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.tar.gz
plus-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.tar.bz2
plus-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.tar.xz
plus-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.zip
Add strong typed bool type Visible.
Diffstat (limited to 'src/gui/widgets/popuplist.cpp')
-rw-r--r--src/gui/widgets/popuplist.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp
index d8c1d79dc..17f026388 100644
--- a/src/gui/widgets/popuplist.cpp
+++ b/src/gui/widgets/popuplist.cpp
@@ -88,7 +88,7 @@ void PopupList::show(int x, int y)
if (mainGraphics->mHeight < (y + height + 5))
y = mainGraphics->mHeight - height;
setPosition(x, y);
- setVisible(true);
+ setVisible(Visible_true);
requestMoveToTop();
if (mModal == Modal_true)
requestModalFocus();
@@ -154,7 +154,7 @@ void PopupList::mouseReleased(MouseEvent& event)
return;
if (mDropDown)
mDropDown->updateSelection();
- setVisible(false);
+ setVisible(Visible_false);
if (mModal == Modal_true)
releaseModalFocus();
}
@@ -162,15 +162,18 @@ void PopupList::mouseReleased(MouseEvent& event)
void PopupList::focusGained(const Event& event)
{
const Widget *const source = event.getSource();
- if (!mVisible || source == this || source == mListBox
- || source == mScrollArea || source == mDropDown)
+ if (mVisible == Visible_false ||
+ source == this ||
+ source == mListBox ||
+ source == mScrollArea ||
+ source == mDropDown)
{
return;
}
if (mDropDown)
mDropDown->updateSelection();
- setVisible(false);
+ setVisible(Visible_false);
if (mModal == Modal_true)
releaseModalFocus();
}