diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-05 18:29:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-05 18:29:07 +0300 |
commit | 71fd4e8d3255e15c16a4f4b51c87222c661a5b33 (patch) | |
tree | 3942aec29f33b5ea2aa2e353451e10648f1bbb82 /src/gui/widgets/window.cpp | |
parent | 45460ca58b3cbf6d92fe3cac1311bbfc9d00e841 (diff) | |
download | plus-71fd4e8d3255e15c16a4f4b51c87222c661a5b33.tar.gz plus-71fd4e8d3255e15c16a4f4b51c87222c661a5b33.tar.bz2 plus-71fd4e8d3255e15c16a4f4b51c87222c661a5b33.tar.xz plus-71fd4e8d3255e15c16a4f4b51c87222c661a5b33.zip |
Add strong typed bool type for modal bool flag.
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r-- | src/gui/widgets/window.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index f29027566..c438b5475 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -98,8 +98,10 @@ const int resizeMask = 8 + 4 + 2 + 1; int Window::windowInstances = 0; int Window::mouseResize = 0; -Window::Window(const std::string &caption, const bool modal, - Window *const parent, std::string skin) : +Window::Window(const std::string &caption, + const Modal modal, + Window *const parent, + std::string skin) : BasicContainer2(nullptr), MouseListener(), WidgetListener(), @@ -137,8 +139,8 @@ Window::Window(const std::string &caption, const bool modal, mResizeHandles(-1), mOldResizeHandles(-1), mCaptionFont(getFont()), - mShowTitle(true), mModal(modal), + mShowTitle(true), mCloseWindowButton(false), mDefaultVisible(false), mSaveVisible(false), @@ -201,7 +203,7 @@ Window::Window(const std::string &caption, const bool modal, if (windowContainer) windowContainer->add(this); - if (mModal) + if (mModal == Modal_true) { gui->setCursorType(Cursor::CURSOR_POINTER); requestModalFocus(); @@ -938,12 +940,12 @@ void Window::mouseDragged(MouseEvent &event) } } -void Window::setModal(const bool modal) +void Window::setModal(const Modal modal) { if (mModal != modal) { mModal = modal; - if (mModal) + if (mModal == Modal_true) { if (gui) gui->setCursorType(Cursor::CURSOR_POINTER); |