GUI: Make disabled EditTextWidget not allowing to edit the string

This commit is contained in:
Eugene Sandulenko 2015-11-06 05:13:05 +01:00
parent b8caa07ddb
commit 6f44d4f7e1
2 changed files with 7 additions and 1 deletions

View file

@ -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);

View file

@ -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);