From: <sa...@us...> - 2006-07-17 04:30:58
|
Revision: 16501 Author: sadrul Date: 2006-07-16 21:30:50 -0700 (Sun, 16 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16501&view=rev Log Message: ----------- Minor adjustments to the packing of child widgets in a box. Modified Paths: -------------- trunk/console/gntnotify.c trunk/console/libgnt/gntbox.c trunk/console/libgnt/gntbox.h trunk/console/libgnt/test/focus.c trunk/console/libgnt/test/tv.c Modified: trunk/console/gntnotify.c =================================================================== --- trunk/console/gntnotify.c 2006-07-17 03:45:24 UTC (rev 16500) +++ trunk/console/gntnotify.c 2006-07-17 04:30:50 UTC (rev 16501) @@ -29,6 +29,8 @@ window = gnt_box_new(FALSE, TRUE); gnt_box_set_toplevel(GNT_BOX(window), TRUE); gnt_box_set_title(GNT_BOX(window), title); + gnt_box_set_fill(GNT_BOX(window), FALSE); + gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID); if (primary) gnt_box_add_widget(GNT_BOX(window), Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-07-17 03:45:24 UTC (rev 16500) +++ trunk/console/libgnt/gntbox.c 2006-07-17 04:30:50 UTC (rev 16501) @@ -173,31 +173,30 @@ if (maxw < w) maxw = w; } - - if (box->homogeneous) + + for (iter = box->list; iter; iter = iter->next) { - for (iter = box->list; iter; iter = iter->next) + int w, h; + GntWidget *wid = GNT_WIDGET(iter->data); + + gnt_widget_get_size(wid, &w, &h); + + if (box->homogeneous) { - gnt_widget_set_size(GNT_WIDGET(iter->data), maxw, maxh); + if (box->vertical) + h = maxh; + else + w = maxw; } - } - else - { - for (iter = box->list; iter; iter = iter->next) + if (box->fill) { if (box->vertical) - { - int h; - gnt_widget_get_size(GNT_WIDGET(iter->data), NULL, &h); - gnt_widget_set_size(GNT_WIDGET(iter->data), maxw, h); - } + w = maxw; else - { - int w; - gnt_widget_get_size(GNT_WIDGET(iter->data), &w, NULL); - gnt_widget_set_size(GNT_WIDGET(iter->data), w, maxh); - } + h = maxh; } + + gnt_widget_set_size(wid, w, h); } reposition_children(widget); @@ -495,6 +494,7 @@ box->homogeneous = homo; box->vertical = vert; box->pad = 1; + box->fill = TRUE; gnt_widget_set_take_focus(widget, TRUE); GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); if (vert) @@ -669,3 +669,8 @@ } } +void gnt_box_set_fill(GntBox *box, gboolean fill) +{ + box->fill = fill; +} + Modified: trunk/console/libgnt/gntbox.h =================================================================== --- trunk/console/libgnt/gntbox.h 2006-07-17 03:45:24 UTC (rev 16500) +++ trunk/console/libgnt/gntbox.h 2006-07-17 04:30:50 UTC (rev 16501) @@ -33,6 +33,7 @@ gboolean vertical; gboolean homogeneous; + gboolean fill; GList *list; /* List of widgets */ GntWidget *active; @@ -85,6 +86,8 @@ void gnt_box_readjust(GntBox *box); +void gnt_box_set_fill(GntBox *box, gboolean fill); + G_END_DECLS #endif /* GNT_BOX_H */ Modified: trunk/console/libgnt/test/focus.c =================================================================== --- trunk/console/libgnt/test/focus.c 2006-07-17 03:45:24 UTC (rev 16500) +++ trunk/console/libgnt/test/focus.c 2006-07-17 04:30:50 UTC (rev 16501) @@ -32,6 +32,7 @@ vbox = gnt_box_new(FALSE, FALSE); hbox = gnt_box_new(FALSE, TRUE); + gnt_box_set_alignment(GNT_BOX(hbox), GNT_ALIGN_MID); gnt_widget_set_name(vbox, "vbox"); gnt_widget_set_name(hbox, "hbox"); Modified: trunk/console/libgnt/test/tv.c =================================================================== --- trunk/console/libgnt/test/tv.c 2006-07-17 03:45:24 UTC (rev 16500) +++ trunk/console/libgnt/test/tv.c 2006-07-17 04:30:50 UTC (rev 16501) @@ -45,7 +45,9 @@ hbox = gnt_box_new(FALSE, TRUE); gnt_widget_set_name(hbox, "hbox"); gnt_box_set_toplevel(GNT_BOX(hbox), TRUE); + gnt_box_set_fill(GNT_BOX(hbox), FALSE); gnt_box_set_title(GNT_BOX(hbox), "Textview test"); + gnt_box_set_alignment(GNT_BOX(hbox), GNT_ALIGN_MID); entry = gnt_entry_new(NULL); gnt_widget_set_name(entry, "entry"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |