From 46309fe68d238605458ab449487c374e898f6c34 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 24 Aug 2015 16:45:35 -0300 Subject: [PATCH] Focus Entry field when a Combobox receives the focus for first time This is a partial revert of a0c2237839ff8a361de31ba0101caae9e7e53028 patch. --- src/ui/combobox.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ui/combobox.cpp b/src/ui/combobox.cpp index 883993482..b2405da29 100644 --- a/src/ui/combobox.cpp +++ b/src/ui/combobox.cpp @@ -364,6 +364,17 @@ bool ComboBox::onProcessMessage(Message* msg) } break; + case kFocusEnterMessage: + // Here we focus the entry field only if the combobox is + // editable and receives the focus in a direct way (e.g. when + // the window was just opened and the combobox is the first + // child or has the "focus magnet" flag enabled.) + if ((isEditable()) && + (getManager()->getFocus() == this)) { + m_entry->requestFocus(); + } + break; + } return Widget::onProcessMessage(msg);