mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-14 03:40:55 +00:00
Fix the autocomplete timer activation/deactivation in CustomFileNameEntry
The kKeyUpMessage was received when we opened the open/save file dialog with a shortcut (e.g. Ctrl+Shift+S), so the timer was triggered and the autocomplete activated. After that, the text was unselected (as it looks like fully autocompleted). Now we activate the timer to autocomplete only when the field is modified (onEntryChange).
This commit is contained in:
parent
ee685e419e
commit
1ac99c04ae
@ -116,20 +116,11 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual bool onProcessMessage(Message* msg) override {
|
||||
switch (msg->type()) {
|
||||
virtual void onEntryChange() override {
|
||||
Entry::onEntryChange();
|
||||
|
||||
case kKeyDownMessage:
|
||||
m_timer.stop();
|
||||
break;
|
||||
|
||||
case kKeyUpMessage:
|
||||
if (static_cast<KeyMessage*>(msg)->unicodeChar() >= 32)
|
||||
m_timer.start();
|
||||
break;
|
||||
|
||||
}
|
||||
return Entry::onProcessMessage(msg);
|
||||
// Start timer to autocomplete again.
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
void onTick() {
|
||||
|
Loading…
Reference in New Issue
Block a user