Revision: 6973
Author: nogu.dev
Date: Sat Feb 19 18:38:12 2011
Log: * helper/toolbar-standalone-gtk.c
- (button_press_event_cb): Fix handling of negative values and zero.
http://code.google.com/p/uim/source/detail?r=6973
Modified:
/trunk/helper/toolbar-standalone-gtk.c
=======================================
--- /trunk/helper/toolbar-standalone-gtk.c Thu Feb 17 02:07:06 2011
+++ /trunk/helper/toolbar-standalone-gtk.c Sat Feb 19 18:38:12 2011
@@ -105,10 +105,13 @@
}
#if GTK_CHECK_VERSION(2, 90, 0)
{
- GtkRequisition req;
- req.width = 1;
- req.height = (height > 0) ? height : 1;
- size_request_cb(widget, &req, NULL);
+ GtkRequisition minimum_size, natural_size;
+ gtk_widget_get_preferred_size(widget, &minimum_size, &natural_size);
+ if (height > 0)
+ natural_size.height = height;
+ else if (height == 0)
+ natural_size.height = minimum_size.height;
+ size_request_cb(widget, &natural_size, NULL);
}
#else
gtk_widget_set_size_request(widget, -1, height);