pidgin: 5bcc955b: Make the combobox a bit more friendly.

sadrul at pidgin.im sadrul at pidgin.im
Mon Jul 5 00:46:39 EDT 2010


----------------------------------------------------------------------
Revision: 5bcc955b6b9161a848b0a011cbb7d8dfa3f928bd
Parent:   6be1d8afd29f8e7fdee5f915814fb2153900a136
Author:   sadrul at pidgin.im
Date:     07/05/10 00:44:52
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5bcc955b6b9161a848b0a011cbb7d8dfa3f928bd

Changelog: 

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.

Changes against parent 6be1d8afd29f8e7fdee5f915814fb2153900a136

  patched  finch/libgnt/gntcombobox.c

-------------- next part --------------
============================================================
--- finch/libgnt/gntcombobox.c	5eb790b149b6444fcb4e1647617135e9c0588145
+++ finch/libgnt/gntcombobox.c	99d6791e47a44852d6c5734f18f492fc7cad11fa
@@ -150,12 +150,9 @@ gnt_combo_box_key_pressed(GntWidget *wid
 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,10 +163,14 @@ gnt_combo_box_key_pressed(GntWidget *wid
 					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;
 }
 


More information about the Commits mailing list