GUI: Make disabled EditTextWidget not allowing to edit the string
This commit is contained in:
parent
b8caa07ddb
commit
6f44d4f7e1
2 changed files with 7 additions and 1 deletions
|
@ -79,7 +79,7 @@ bool EditableWidget::tryInsertChar(byte c, int pos) {
|
||||||
|
|
||||||
void EditableWidget::handleTickle() {
|
void EditableWidget::handleTickle() {
|
||||||
uint32 time = g_system->getMillis();
|
uint32 time = g_system->getMillis();
|
||||||
if (_caretTime < time) {
|
if (_caretTime < time && isEnabled()) {
|
||||||
_caretTime = time + kCaretBlinkTime;
|
_caretTime = time + kCaretBlinkTime;
|
||||||
drawCaret(_caretVisible);
|
drawCaret(_caretVisible);
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,9 @@ bool EditableWidget::handleKeyDown(Common::KeyState state) {
|
||||||
bool dirty = false;
|
bool dirty = false;
|
||||||
bool forcecaret = false;
|
bool forcecaret = false;
|
||||||
|
|
||||||
|
if (!isEnabled())
|
||||||
|
return false;
|
||||||
|
|
||||||
// First remove caret
|
// First remove caret
|
||||||
if (_caretVisible)
|
if (_caretVisible)
|
||||||
drawCaret(true);
|
drawCaret(true);
|
||||||
|
|
|
@ -62,6 +62,9 @@ void EditTextWidget::reflowLayout() {
|
||||||
|
|
||||||
|
|
||||||
void EditTextWidget::handleMouseDown(int x, int y, int button, int clickCount) {
|
void EditTextWidget::handleMouseDown(int x, int y, int button, int clickCount) {
|
||||||
|
if (!isEnabled())
|
||||||
|
return;
|
||||||
|
|
||||||
// First remove caret
|
// First remove caret
|
||||||
if (_caretVisible)
|
if (_caretVisible)
|
||||||
drawCaret(true);
|
drawCaret(true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue