changeset 14932:94c69d2efae5

[gaim-migrate @ 17704] Fix some weird cases where the widgets are packed incorrectly in a box. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 08 Nov 2006 05:22:38 +0000
parents d7732681329b
children e6ac2ca2da0f
files console/libgnt/gntwidget.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/console/libgnt/gntwidget.c	Wed Nov 08 05:19:21 2006 +0000
+++ b/console/libgnt/gntwidget.c	Wed Nov 08 05:22:38 2006 +0000
@@ -322,6 +322,7 @@
 	if (widget->window == NULL)
 	{
 		int x, y, maxx, maxy, w, h;
+		int oldw, oldh;
 		gboolean shadow = TRUE;
 
 		if (!gnt_widget_has_shadow(widget))
@@ -329,8 +330,8 @@
 
 		x = widget->priv.x;
 		y = widget->priv.y;
-		w = widget->priv.width + shadow;
-		h = widget->priv.height + shadow;
+		w = oldw = widget->priv.width + shadow;
+		h = oldh = widget->priv.height + shadow;
 
 		getmaxyx(stdscr, maxy, maxx);
 		maxy -= 1;		/* room for the taskbar */
@@ -347,8 +348,11 @@
 
 		widget->priv.x = x;
 		widget->priv.y = y;
-		widget->priv.width = w - shadow;
-		widget->priv.height = h - shadow;
+		if (w != oldw || h != oldh) {
+			widget->priv.width = w - shadow;
+			widget->priv.height = h - shadow;
+			g_signal_emit(widget, signals[SIG_SIZE_CHANGED], 0, oldw, oldh);
+		}
 
 		widget->window = newwin(widget->priv.height + shadow, widget->priv.width + shadow,
 						widget->priv.y, widget->priv.x);