From 01a0e4b658241cc3dbd8a5d11d34a6de48dab159 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 28 May 2015 00:55:13 +0300 Subject: Add strong typed bool type Visible. --- src/gui/widgets/popuplist.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/gui/widgets/popuplist.cpp') 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(); } -- cgit v1.2.3-70-g09d2