Mercurial > pidgin.yaz
changeset 15951:9214184b9d10
merge of '58f408c6a0eb5c8b0411d8ac4754a14bef441062'
and 'fba53203d9fe0ebd98157bdc6c7faeb2b149908b'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Tue, 27 Mar 2007 03:51:42 +0000 |
parents | 92fa7d6e75b0 (diff) 5c88d2887cc1 (current diff) |
children | 0ef26ac647ac 65b5b2b9b5bc |
files | |
diffstat | 2 files changed, 15 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/finch/libgnt/gntbox.c Tue Mar 27 03:08:31 2007 +0000 +++ b/finch/libgnt/gntbox.c Tue Mar 27 03:51:42 2007 +0000 @@ -352,11 +352,6 @@ GntBox *box = GNT_BOX(widget); int wchange, hchange; - if (widget->priv.width != width && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_X)) - return FALSE; - if (widget->priv.height != height && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_Y)) - return FALSE; - if (!box->list) return TRUE; @@ -387,13 +382,21 @@ gnt_widget_get_size(GNT_WIDGET(i->data), &tw, &th); if (box->vertical) { - if (!gnt_widget_confirm_size(i->data, tw - wchange, th)) - return FALSE; + if (!gnt_widget_confirm_size(i->data, tw - wchange, th)) { + /* If we are decreasing the size and the widget is going + * to be too large to fit into the box, then do not allow + * resizing. */ + if (wchange > 0 && tw >= widget->priv.width) + return FALSE; + } } else { - if (!gnt_widget_confirm_size(i->data, tw, th - hchange)) + if (!gnt_widget_confirm_size(i->data, tw, th - hchange)) { + if (hchange > 0 && th >= widget->priv.height) + return FALSE; return FALSE; + } } } #if 0 @@ -562,17 +565,6 @@ { b->list = g_list_append(b->list, widget); widget->parent = GNT_WIDGET(b); - - if (b->vertical) - { - if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_X)) - GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(b), GNT_WIDGET_GROW_X); - } - else - { - if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_Y)) - GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(b), GNT_WIDGET_GROW_Y); - } } void gnt_box_set_title(GntBox *b, const char *title)
--- a/finch/libgnt/gntwidget.c Tue Mar 27 03:08:31 2007 +0000 +++ b/finch/libgnt/gntwidget.c Tue Mar 27 03:51:42 2007 +0000 @@ -75,11 +75,13 @@ static gboolean gnt_widget_dummy_confirm_size(GntWidget *widget, int width, int height) { + gboolean shadow; if (width < widget->priv.minw || height < widget->priv.minh) return FALSE; - if (widget->priv.width != width && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_X)) + shadow = gnt_widget_has_shadow(widget); + if (widget->priv.width + shadow != width && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_X)) return FALSE; - if (widget->priv.height != height && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_Y)) + if (widget->priv.height + shadow != height && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_Y)) return FALSE; return TRUE; }