Tweak the box-resizing a bit.

Fri, 02 Apr 2010 02:16:25 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Fri, 02 Apr 2010 02:16:25 +0000
changeset 29944
195cf568207b
parent 29943
8bd0701c9bbd
child 29946
ab9774550c0f

Tweak the box-resizing a bit.

This change should make the widgets inside a window resize a bit more
predictably. Still not perfect, but better than before.

finch/libgnt/gntbox.c file | annotate | diff | comparison | revisions
--- a/finch/libgnt/gntbox.c	Thu Apr 01 06:51:04 2010 +0000
+++ b/finch/libgnt/gntbox.c	Fri Apr 02 02:16:25 2010 +0000
@@ -422,7 +422,7 @@
 
 		gnt_widget_get_size(wid, &w, &h);
 
-		if (wid != last && !child && gnt_widget_confirm_size(wid, w - wchange, h - hchange)) {
+		if (wid != last && !child && w > 0 && h > 0 && gnt_widget_confirm_size(wid, w - wchange, h - hchange)) {
 			child = wid;
 			break;
 		}
@@ -442,6 +442,9 @@
 			GntWidget *wid = iter->data;
 			int w, h;
 
+			if (wid == child)
+				continue;
+
 			gnt_widget_get_size(wid, &w, &h);
 			if (box->vertical) {
 				/* For a vertical box, if we are changing the width, make sure the widgets

mercurial