mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Tweaked IntEntry behavior
Changed behavior of IntEntry to stop it from continously selecting all text as long as the mouse is over the input box. It appears that something continues to send kMouseEnterMessage messages while use is typing, even if the mouse is still. This caused the IntEntry select-all multiple times and as the user typed would replace what they had already written. Also force value to be set within min >= value >= max when focus is lost. This will get rid of bad values from the entry, such as 10q goes to 10, 40000 goes to 255, etc.
This commit is contained in:
parent
86dab97cac
commit
838382791e
@ -64,7 +64,11 @@ bool IntEntry::onProcessMessage(Message* msg)
|
||||
// text is automatically selected.
|
||||
case kMouseEnterMessage:
|
||||
requestFocus();
|
||||
selectText(0, -1);
|
||||
break;
|
||||
|
||||
// Reset value if it's out of bounds when focus is lost
|
||||
case kFocusLeaveMessage:
|
||||
setValue(MID(m_min, getValue(), m_max));
|
||||
break;
|
||||
|
||||
case kMouseDownMessage:
|
||||
|
Loading…
x
Reference in New Issue
Block a user