comparison finch/libgnt/gntbox.c @ 21626:4c03275346a9

Fix moving focus in an internal box.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 26 Nov 2007 04:45:41 +0000
parents 7f1910f62246
children d03b32530854
comparison
equal deleted inserted replaced
21625:e5606c720791 21626:4c03275346a9
849 gnt_widget_draw(GNT_WIDGET(box)); 849 gnt_widget_draw(GNT_WIDGET(box));
850 } 850 }
851 851
852 void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget) 852 void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget)
853 { 853 {
854 GList *find = g_list_find(box->focus, widget); 854 GList *find;
855 gpointer now = box->active; 855 gpointer now;
856
857 while (GNT_WIDGET(box)->parent)
858 box = GNT_BOX(GNT_WIDGET(box)->parent);
859
860 find = g_list_find(box->focus, widget);
861 now = box->active;
856 if (find) 862 if (find)
857 box->active = widget; 863 box->active = widget;
858 if (now && now != box->active) 864 if (now && now != box->active)
859 { 865 {
860 gnt_widget_set_focus(now, FALSE); 866 gnt_widget_set_focus(now, FALSE);