Mercurial > pidgin.yaz
diff console/libgnt/gntcombobox.c @ 13943:25be562aaca8
[gaim-migrate @ 16480]
New widget GntLine to use as a separator.
A partial dialog for add-account callback. Updating the dialog
as a result of selection-change in the prpl dropdown is way ickier
than I had expected it to be. It 'works' now, but quite a bit
quirky. I will try to smooth things up later, perhaps next week.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 10 Jul 2006 23:55:24 +0000 |
parents | 669898e6aa11 |
children | 0a0d2a1fd2bc |
line wrap: on
line diff
--- a/console/libgnt/gntcombobox.c Mon Jul 10 18:08:11 2006 +0000 +++ b/console/libgnt/gntcombobox.c Mon Jul 10 23:55:24 2006 +0000 @@ -31,13 +31,13 @@ gnt_combo_box_draw(GntWidget *widget) { GntComboBox *box = GNT_COMBO_BOX(widget); - const char *text = NULL; + char *text = NULL; GntColorType type; int len; if (box->dropdown) { - text = gnt_tree_get_selection_text(GNT_TREE(box->dropdown)); + text = (char *)gnt_tree_get_selection_text(GNT_TREE(box->dropdown)); box->selected = gnt_tree_get_selection_data(GNT_TREE(box->dropdown)); } @@ -96,7 +96,6 @@ { case '\r': case '\t': - /* XXX: Get the selction */ set_selection(box, gnt_tree_get_selection_data(GNT_TREE(box->dropdown))); case 27: gnt_widget_hide(box->dropdown->parent); @@ -114,10 +113,19 @@ if (strcmp(text + 1, GNT_KEY_UP) == 0 || strcmp(text + 1, GNT_KEY_DOWN) == 0) { + GntWidget *parent = box->dropdown->parent; gnt_widget_set_size(box->dropdown, widget->priv.width, 9); - gnt_widget_set_position(box->dropdown->parent, + gnt_widget_set_position(parent, widget->priv.x, widget->priv.y + widget->priv.height - 1); - gnt_widget_draw(box->dropdown->parent); + if (parent->window) + { + if (mvwin(parent->window, widget->priv.y + widget->priv.height - 1, + widget->priv.x) == ERR) + mvwin(parent->window, + widget->priv.y - 9 + 1, widget->priv.x); + } + + gnt_widget_draw(parent); return TRUE; } } @@ -171,6 +179,7 @@ gnt_combo_box_init(GTypeInstance *instance, gpointer class) { GntWidget *box; + GntWidget *widget = GNT_WIDGET(instance); GntComboBox *combo = GNT_COMBO_BOX(instance); GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), @@ -182,6 +191,8 @@ gnt_box_set_pad(GNT_BOX(box), 0); gnt_box_add_widget(GNT_BOX(box), combo->dropdown); + widget->priv.minw = 4; + widget->priv.minh = 3; DEBUG; }