diff options
author | Eugene Sandulenko | 2015-11-06 05:13:05 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2015-11-07 13:26:55 +0100 |
commit | 6f44d4f7e199813e7cfc68c7be246a08afe6df40 (patch) | |
tree | 53c2fe111ad3988ffad8f78fd2da4bf85229cbc8 /gui/widgets | |
parent | b8caa07ddb2e31cdebbbc012adbf11f721a2fd3a (diff) | |
download | scummvm-rg350-6f44d4f7e199813e7cfc68c7be246a08afe6df40.tar.gz scummvm-rg350-6f44d4f7e199813e7cfc68c7be246a08afe6df40.tar.bz2 scummvm-rg350-6f44d4f7e199813e7cfc68c7be246a08afe6df40.zip |
GUI: Make disabled EditTextWidget not allowing to edit the string
Diffstat (limited to 'gui/widgets')
-rw-r--r-- | gui/widgets/editable.cpp | 5 | ||||
-rw-r--r-- | gui/widgets/edittext.cpp | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gui/widgets/editable.cpp b/gui/widgets/editable.cpp index af3e5e9b9a..2d929113b1 100644 --- a/gui/widgets/editable.cpp +++ b/gui/widgets/editable.cpp @@ -79,7 +79,7 @@ bool EditableWidget::tryInsertChar(byte c, int pos) { void EditableWidget::handleTickle() { uint32 time = g_system->getMillis(); - if (_caretTime < time) { + if (_caretTime < time && isEnabled()) { _caretTime = time + kCaretBlinkTime; drawCaret(_caretVisible); } @@ -90,6 +90,9 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) { bool dirty = false; bool forcecaret = false; + if (!isEnabled()) + return false; + // First remove caret if (_caretVisible) drawCaret(true); diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp index 550b1bd153..1481bebae3 100644 --- a/gui/widgets/edittext.cpp +++ b/gui/widgets/edittext.cpp @@ -62,6 +62,9 @@ void EditTextWidget::reflowLayout() { void EditTextWidget::handleMouseDown(int x, int y, int button, int clickCount) { + if (!isEnabled()) + return; + // First remove caret if (_caretVisible) drawCaret(true); |