[maemo-commits] [maemo-commits] r11170 - in projects/haf/trunk/gtk+: . gtk tests

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Apr 20 13:26:19 EEST 2007
Author: mitch
Date: 2007-04-20 13:26:16 +0300 (Fri, 20 Apr 2007)
New Revision: 11170

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtkarrow.c
   projects/haf/trunk/gtk+/tests/testgtk.c
   projects/haf/trunk/gtk+/tests/testgtkrc
Log:
2007-04-20  Michael Natterer  <mitch at imendio.com>

	Merge from upstream trunk:

    Tue Sep 19 17:00:04 2006  Tim Janik  <timj at imendio.com>

	* gtk/gtkarrow.c: added GtkArrow::arrow-scaling style property to 
	control the arrow/border ratio within the allocation.

	* tests/testgtk.c: added a GtkArrow to handle box test.

	* tests/testgtkrc: test ::arrow-scaling property.



Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2007-04-20 10:01:39 UTC (rev 11169)
+++ projects/haf/trunk/gtk+/ChangeLog	2007-04-20 10:26:16 UTC (rev 11170)
@@ -1,3 +1,16 @@
+2007-04-20  Michael Natterer  <mitch at imendio.com>
+
+	Merge from upstream trunk:
+
+    Tue Sep 19 17:00:04 2006  Tim Janik  <timj at imendio.com>
+
+	* gtk/gtkarrow.c: added GtkArrow::arrow-scaling style property to 
+	control the arrow/border ratio within the allocation.
+
+	* tests/testgtk.c: added a GtkArrow to handle box test.
+
+	* tests/testgtkrc: test ::arrow-scaling property.
+
 2007-04-19  Xan Lopez  <xan.lopez at nokia.com>
 
 	* gtk/gtkmain.c (gtk_main_do_event): send the insensitive-press

Modified: projects/haf/trunk/gtk+/gtk/gtkarrow.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkarrow.c	2007-04-20 10:01:39 UTC (rev 11169)
+++ projects/haf/trunk/gtk+/gtk/gtkarrow.c	2007-04-20 10:26:16 UTC (rev 11170)
@@ -86,7 +86,13 @@
 						      GTK_TYPE_SHADOW_TYPE,
 						      GTK_SHADOW_OUT,
                                                       GTK_PARAM_READWRITE));
-  
+  gtk_widget_class_install_style_property (widget_class,
+                                           g_param_spec_float ("arrow-scaling",
+                                                               P_("Arrow Scaling"),
+                                                               P_("Amount of space used up by arrow"),
+                                                               0.0, 1.0, 0.7,
+                                                               GTK_PARAM_READABLE));
+
   widget_class->expose_event = gtk_arrow_expose;
 }
 
@@ -204,8 +210,6 @@
 gtk_arrow_expose (GtkWidget      *widget,
 		  GdkEventExpose *event)
 {
-  GtkArrow *arrow;
-  GtkMisc *misc;
   GtkShadowType shadow_type;
   gint width, height;
   gint x, y;
@@ -215,15 +219,14 @@
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      arrow = GTK_ARROW (widget);
-      misc = GTK_MISC (widget);
+      GtkArrow *arrow = GTK_ARROW (widget);
+      GtkMisc *misc = GTK_MISC (widget);
+      gfloat arrow_scaling;
+      gtk_widget_style_get (widget, "arrow-scaling", &arrow_scaling, NULL);
 
       width = widget->allocation.width - misc->xpad * 2;
       height = widget->allocation.height - misc->ypad * 2;
-      extent = MIN (width, height) * 0.7;
-#ifdef MAEMO_CHANGES
-      extent = MIN (width, height);
-#endif /* MAEMO_CHANGES */
+      extent = MIN (width, height) * arrow_scaling;
       effective_arrow_type = arrow->arrow_type;
 
       if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)

Modified: projects/haf/trunk/gtk+/tests/testgtk.c
===================================================================
--- projects/haf/trunk/gtk+/tests/testgtk.c	2007-04-20 10:01:39 UTC (rev 11169)
+++ projects/haf/trunk/gtk+/tests/testgtk.c	2007-04-20 10:26:16 UTC (rev 11170)
@@ -2397,9 +2397,11 @@
 		      "detached");
     gtk_widget_show (handle_box2);
 
+    hbox = g_object_new (GTK_TYPE_HBOX, "visible", 1, "parent", handle_box2, NULL);
     label = gtk_label_new ("Fooo!");
-    gtk_container_add (GTK_CONTAINER (handle_box2), label);
+    gtk_container_add (GTK_CONTAINER (hbox), label);
     gtk_widget_show (label);
+    g_object_new (GTK_TYPE_ARROW, "visible", 1, "parent", hbox, NULL);
   }
 
   if (!GTK_WIDGET_VISIBLE (window))

Modified: projects/haf/trunk/gtk+/tests/testgtkrc
===================================================================
--- projects/haf/trunk/gtk+/tests/testgtkrc	2007-04-20 10:01:39 UTC (rev 11169)
+++ projects/haf/trunk/gtk+/tests/testgtkrc	2007-04-20 10:26:16 UTC (rev 11170)
@@ -31,6 +31,7 @@
   GtkToolbar::button_relief = none
   GtkButtonBox::child_min_width = 0
   GtkButtonBox::child_min_height = 0
+  GtkArrow::arrow-scaling = 1.0
 }
 class "GtkWidget" style "global-style-properties"
 


More information about the maemo-commits mailing list