Revision 58f408c6a0eb5c8b0411d8ac4754a14bef441062

sadrul at pidgin.im sadrul at pidgin.im
Mon Mar 26 23:50:50 EDT 2007


o   -----------------------------------------------------------------
|   Revision: 58f408c6a0eb5c8b0411d8ac4754a14bef441062
|   Ancestor: f894448f712134780a75dba19622a78626a98231
|   Author: sadrul at pidgin.im
|   Date: 2007-03-27T03:50:04
|   Branch: im.pidgin.pidgin
|   
|   Modified files:
|           finch/libgnt/gntbox.c finch/libgnt/gntwidget.c
|   
|   ChangeLog: 
|   
|   A few more fixes for resizing.
|   
|   ============================================================
|   --- finch/libgnt/gntbox.c	8d537d98512519f9b3043f2a0cacd240d7e127cb
|   +++ finch/libgnt/gntbox.c	dc9cc0d4b8f61eafc7517066238e9d5d8e527a4a
|   @@ -352,11 +352,6 @@ gnt_box_confirm_size(GntWidget *widget, 
|    	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_box_confirm_size(GntWidget *widget, 
|    				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 @@ void gnt_box_add_widget(GntBox *b, GntWi
|    {
|    	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)
|   ============================================================
|   --- finch/libgnt/gntwidget.c	858cfe29a2cd8af5f1802b83ae7dc32bdc6eefee
|   +++ finch/libgnt/gntwidget.c	decb2af4f62f04ce59969945c68c9bd9ca1bcf0e
|   @@ -75,11 +75,13 @@ gnt_widget_dummy_confirm_size(GntWidget 
|    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;
|    }

To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from 58f408c6a0eb5c8b0411d8ac4754a14bef441062


More information about the Commits mailing list