gimp r26511 - in trunk: . modules



Author: mitch
Date: Tue Aug 12 12:48:02 2008
New Revision: 26511
URL: http://svn.gnome.org/viewvc/gimp?rev=26511&view=rev

Log:
2008-08-12  Michael Natterer  <mitch gimp org>

	* modules/color-selector-wheel.c: override the wheel's
	size-allocate and return a small requisition that allows to be
	resized smaller again.



Modified:
   trunk/ChangeLog
   trunk/modules/color-selector-wheel.c

Modified: trunk/modules/color-selector-wheel.c
==============================================================================
--- trunk/modules/color-selector-wheel.c	(original)
+++ trunk/modules/color-selector-wheel.c	Tue Aug 12 12:48:02 2008
@@ -86,6 +86,9 @@
 static void   colorsel_wheel_size_allocate (GtkWidget         *frame,
                                             GtkAllocation     *allocation,
                                             ColorselWheel     *wheel);
+static void   colorsel_wheel_size_request  (GtkWidget         *hsv,
+                                            GtkRequisition    *requisition,
+                                            ColorselWheel     *wheel);
 static void   colorsel_wheel_changed       (GtkHSV            *hsv,
                                             GimpColorSelector *selector);
 
@@ -163,6 +166,10 @@
   gtk_container_add (GTK_CONTAINER (frame), wheel->hsv);
   gtk_widget_show (wheel->hsv);
 
+  g_signal_connect (wheel->hsv, "size-request",
+                    G_CALLBACK (colorsel_wheel_size_request),
+                    wheel);
+
   g_signal_connect (wheel->hsv, "changed",
                     G_CALLBACK (colorsel_wheel_changed),
                     wheel);
@@ -184,23 +191,40 @@
                               ColorselWheel *wheel)
 {
   GtkStyle *style = gtk_widget_get_style (frame);
-  gint      focus_line_width;
+  gint      focus_width;
   gint      focus_padding;
   gint      size;
 
   gtk_widget_style_get (frame,
-                        "focus-line-width", &focus_line_width,
+                        "focus-line-width", &focus_width,
                         "focus-padding",    &focus_padding,
                         NULL);
 
   size = (MIN (allocation->width, allocation->height) -
           2 * MAX (style->xthickness, style->ythickness) -
-          2 * (focus_line_width + focus_padding));
+          2 * (focus_width + focus_padding));
 
   gtk_hsv_set_metrics (GTK_HSV (wheel->hsv), size, size / 10);
 }
 
 static void
+colorsel_wheel_size_request (GtkWidget      *hsv,
+                             GtkRequisition *requisition,
+                             ColorselWheel  *wheel)
+{
+  gint focus_width;
+  gint focus_padding;
+
+  gtk_widget_style_get (hsv,
+                        "focus-line-width", &focus_width,
+                        "focus-padding",    &focus_padding,
+                        NULL);
+
+  requisition->width  = 2 * (focus_width + focus_padding);
+  requisition->height = 2 * (focus_width + focus_padding);
+}
+
+static void
 colorsel_wheel_changed (GtkHSV            *hsv,
                         GimpColorSelector *selector)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]