Mercurial > pidgin
comparison finch/libgnt/gntbox.c @ 26439:c67d43408daa
Update hardware cursor correctly.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 05 Apr 2009 08:22:22 +0000 |
parents | 73e88188a7d4 |
children | 65e8c39cc5f6 |
comparison
equal
deleted
inserted
replaced
26438:fd97c0de433d | 26439:c67d43408daa |
---|---|
76 if (box->focus == NULL && widget->parent == NULL) | 76 if (box->focus == NULL && widget->parent == NULL) |
77 g_list_foreach(box->list, add_to_focus, box); | 77 g_list_foreach(box->list, add_to_focus, box); |
78 | 78 |
79 g_list_foreach(box->list, (GFunc)gnt_widget_draw, NULL); | 79 g_list_foreach(box->list, (GFunc)gnt_widget_draw, NULL); |
80 | 80 |
81 gnt_box_sync_children(box); | |
82 | |
83 if (box->title && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER)) | 81 if (box->title && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER)) |
84 { | 82 { |
85 int pos, right; | 83 int pos, right; |
86 char *title = g_strdup(box->title); | 84 char *title = g_strdup(box->title); |
87 | 85 |
88 get_title_thingies(box, title, &pos, &right); | 86 get_title_thingies(box, title, &pos, &right); |
89 | 87 |
90 if (gnt_widget_has_focus(widget)) | 88 if (gnt_widget_has_focus(widget)) |
91 wbkgdset(widget->window, '\0' | gnt_color_pair(GNT_COLOR_TITLE)); | 89 wbkgdset(widget->window, '\0' | gnt_color_pair(GNT_COLOR_TITLE)); |
92 else | 90 else |
94 mvwaddch(widget->window, 0, pos-1, ACS_RTEE | gnt_color_pair(GNT_COLOR_NORMAL)); | 92 mvwaddch(widget->window, 0, pos-1, ACS_RTEE | gnt_color_pair(GNT_COLOR_NORMAL)); |
95 mvwaddstr(widget->window, 0, pos, title); | 93 mvwaddstr(widget->window, 0, pos, title); |
96 mvwaddch(widget->window, 0, right, ACS_LTEE | gnt_color_pair(GNT_COLOR_NORMAL)); | 94 mvwaddch(widget->window, 0, right, ACS_LTEE | gnt_color_pair(GNT_COLOR_NORMAL)); |
97 g_free(title); | 95 g_free(title); |
98 } | 96 } |
99 | 97 |
100 GNTDEBUG; | 98 gnt_box_sync_children(box); |
101 } | 99 } |
102 | 100 |
103 static void | 101 static void |
104 reposition_children(GntWidget *widget) | 102 reposition_children(GntWidget *widget) |
105 { | 103 { |
721 int pos = 1; | 719 int pos = 1; |
722 | 720 |
723 if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER)) | 721 if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_BORDER)) |
724 pos = 0; | 722 pos = 0; |
725 | 723 |
724 if (!box->active) | |
725 find_focusable_widget(box); | |
726 | |
726 for (iter = box->list; iter; iter = iter->next) | 727 for (iter = box->list; iter; iter = iter->next) |
727 { | 728 { |
728 GntWidget *w = GNT_WIDGET(iter->data); | 729 GntWidget *w = GNT_WIDGET(iter->data); |
729 int height, width; | 730 int height, width; |
730 int x, y; | 731 int x, y; |
762 } | 763 } |
763 | 764 |
764 copywin(w->window, widget->window, 0, 0, | 765 copywin(w->window, widget->window, 0, 0, |
765 y, x, y + height - 1, x + width - 1, FALSE); | 766 y, x, y + height - 1, x + width - 1, FALSE); |
766 gnt_widget_set_position(w, x + widget->priv.x, y + widget->priv.y); | 767 gnt_widget_set_position(w, x + widget->priv.x, y + widget->priv.y); |
768 if (w == box->active) { | |
769 wmove(widget->window, y + getcury(w->window), x + getcurx(w->window)); | |
770 } | |
767 } | 771 } |
768 } | 772 } |
769 | 773 |
770 void gnt_box_set_alignment(GntBox *box, GntAlignment alignment) | 774 void gnt_box_set_alignment(GntBox *box, GntAlignment alignment) |
771 { | 775 { |