# HG changeset patch # User Sadrul Habib Chowdhury # Date 1278305092 0 # Node ID 658e8b9522bceeaee33e1b17a147be6c5a49fd86 # Parent cfdd4d3ba550695ea2a320b6307692ddcb9f25a6 Make the combobox a bit more friendly. While the dropdown in the combobox is not shown, and some key is pressed that triggers an action in the dropdown (e.g. home, end keys etc.), popup the dropdown. diff -r cfdd4d3ba550 -r 658e8b9522bc finch/libgnt/gntcombobox.c --- a/finch/libgnt/gntcombobox.c Mon Jul 05 03:07:37 2010 +0000 +++ b/finch/libgnt/gntcombobox.c Mon Jul 05 04:44:52 2010 +0000 @@ -150,12 +150,9 @@ gnt_combo_box_key_pressed(GntWidget *widget, const char *text) { GntComboBox *box = GNT_COMBO_BOX(widget); - if (GNT_WIDGET_IS_FLAG_SET(box->dropdown->parent, GNT_WIDGET_MAPPED)) - { - if (text[1] == 0) - { - switch (text[0]) - { + if (GNT_WIDGET_IS_FLAG_SET(box->dropdown->parent, GNT_WIDGET_MAPPED)) { + if (text[1] == 0) { + switch (text[0]) { case '\r': case '\t': case '\n': @@ -166,8 +163,12 @@ return TRUE; } } - if (gnt_widget_key_pressed(box->dropdown, text)) - return TRUE; + } + + if (gnt_widget_key_pressed(box->dropdown, text)) { + if (!GNT_WIDGET_IS_FLAG_SET(box->dropdown->parent, GNT_WIDGET_MAPPED)) + popup_dropdown(box); + return TRUE; } return FALSE;