diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-28 00:55:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-28 00:55:13 +0300 |
commit | 01a0e4b658241cc3dbd8a5d11d34a6de48dab159 (patch) | |
tree | 37294c079b9a05768b7380f7595784eb73485769 /src/gui/widgets/chatinput.h | |
parent | 072b727ae4d072d6c84f3331d78ca5a2ac76d271 (diff) | |
download | manaverse-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.tar.gz manaverse-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.tar.bz2 manaverse-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.tar.xz manaverse-01a0e4b658241cc3dbd8a5d11d34a6de48dab159.zip |
Add strong typed bool type Visible.
Diffstat (limited to 'src/gui/widgets/chatinput.h')
-rw-r--r-- | src/gui/widgets/chatinput.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/widgets/chatinput.h b/src/gui/widgets/chatinput.h index b1a22d3fb..592299312 100644 --- a/src/gui/widgets/chatinput.h +++ b/src/gui/widgets/chatinput.h @@ -23,6 +23,8 @@ #ifndef GUI_WIDGETS_CHATINPUT_H #define GUI_WIDGETS_CHATINPUT_H +#include "enums/simpletypes/visible.h" + #include "gui/windows/chatwindow.h" #include "configuration.h" @@ -44,7 +46,7 @@ class ChatInput final : public TextField mWindow(window), mFocusGaining(false) { - setVisible(false); + setVisible(Visible_false); addFocusListener(this); } @@ -59,7 +61,7 @@ class ChatInput final : public TextField TextField::focusLost(event); if (mFocusGaining || !config.getBoolValue("protectChatFocus")) { - processVisible(false); + processVisible(Visible_false); if (chatWindow) chatWindow->updateVisibility(); mFocusGaining = false; @@ -70,12 +72,12 @@ class ChatInput final : public TextField mFocusGaining = false; } - void processVisible(const bool n) + void processVisible(const Visible n) { - if (!mWindow || isVisible() == n) + if (!mWindow || isVisible() == (n == Visible_true)) return; - if (!n) + if (n == Visible_false) mFocusGaining = true; setVisible(n); if (config.getBoolValue("hideChatInput") @@ -92,7 +94,7 @@ class ChatInput final : public TextField void unprotectFocus() { mFocusGaining = true; } - void setVisible(bool visible) + void setVisible(Visible visible) { TextField::setVisible(visible); } |