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:
David Capello 2014-09-11 11:09:26 -03:00
parent ee685e419e
commit 1ac99c04ae

View File

@ -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() {