From: <sa...@us...> - 2006-08-26 13:53:13
|
Revision: 17046 Author: sadrul Date: 2006-08-26 06:53:10 -0700 (Sat, 26 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17046&view=rev Log Message: ----------- Fine-tuning the mouse-event handling in the combobox. Modified Paths: -------------- trunk/console/libgnt/gntcombobox.c Modified: trunk/console/libgnt/gntcombobox.c =================================================================== --- trunk/console/libgnt/gntcombobox.c 2006-08-26 13:03:11 UTC (rev 17045) +++ trunk/console/libgnt/gntcombobox.c 2006-08-26 13:53:10 UTC (rev 17046) @@ -2,6 +2,7 @@ #include "gntcombobox.h" #include "gnttree.h" #include "gntmarshal.h" +#include "gntutils.h" #include <string.h> @@ -39,14 +40,11 @@ GntColorType type; int len; - if (box->dropdown) - { + if (box->dropdown && box->selected) text = gnt_tree_get_selection_text(GNT_TREE(box->dropdown)); - box->selected = gnt_tree_get_selection_data(GNT_TREE(box->dropdown)); - } if (text == NULL) - text = g_strdup(text); + text = g_strdup(""); if (gnt_widget_has_focus(widget)) type = GNT_COLOR_HIGHLIGHT; @@ -57,7 +55,7 @@ if ((len = g_utf8_strlen(text, -1)) > widget->priv.width - 4) { - char *s = g_utf8_offset_to_pointer(text, widget->priv.width - 4); + char *s = gnt_util_onscreen_width_to_pointer(text, widget->priv.width - 4, NULL); *s = '\0'; len = widget->priv.width - 4; } @@ -106,6 +104,7 @@ if (parent->window) { mvwin(parent->window, y, widget->priv.x); + wresize(parent->window, height+2, widget->priv.width); } gnt_widget_draw(parent); @@ -180,11 +179,9 @@ } else if (event == GNT_LEFT_MOUSE_DOWN) { if (dshowing) { set_selection(box, gnt_tree_get_selection_data(GNT_TREE(box->dropdown))); - gnt_tree_set_selected(GNT_TREE(box->dropdown), box->selected); gnt_widget_hide(box->dropdown->parent); } else { popup_dropdown(GNT_COMBO_BOX(widget)); - return TRUE; } } else return FALSE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |