From 1ac99c04ae88c3d614088457a6e6111f7c458f8e Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 11 Sep 2014 11:09:26 -0300 Subject: [PATCH] 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). --- src/app/ui/file_selector.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/app/ui/file_selector.cpp b/src/app/ui/file_selector.cpp index 02d8b2498..a1309084c 100644 --- a/src/app/ui/file_selector.cpp +++ b/src/app/ui/file_selector.cpp @@ -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(msg)->unicodeChar() >= 32) - m_timer.start(); - break; - - } - return Entry::onProcessMessage(msg); + // Start timer to autocomplete again. + m_timer.start(); } void onTick() {