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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Sep 18 15:37:35 EEST 2007
Author: tko
Date: 2007-09-18 15:37:30 +0300 (Tue, 18 Sep 2007)
New Revision: 13890

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtkmenu.c
Log:
Add maemo-arrow-scaling style property

2007-09-18  Tommi Komulainen  <tommi.komulainen at nokia.com>

	* gtk/gtkmenu.c (gtk_menu_class_init, gtk_menu_paint): Add
	maemo-arrow-scaling style property. NB#68989


Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2007-09-18 12:10:27 UTC (rev 13889)
+++ projects/haf/trunk/gtk+/ChangeLog	2007-09-18 12:37:30 UTC (rev 13890)
@@ -1,5 +1,10 @@
 2007-09-18  Tommi Komulainen  <tommi.komulainen at nokia.com>
 
+	* gtk/gtkmenu.c (gtk_menu_class_init, gtk_menu_paint): Add
+	maemo-arrow-scaling style property. NB#68989
+
+2007-09-18  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
 	Patch from Xan Lopez, with small cleanups.
 
 	* gtk/gtkhbbox.c (gtk_hbutton_box_get_children_sizes): New function to

Modified: projects/haf/trunk/gtk+/gtk/gtkmenu.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkmenu.c	2007-09-18 12:10:27 UTC (rev 13889)
+++ projects/haf/trunk/gtk+/gtk/gtkmenu.c	2007-09-18 12:37:30 UTC (rev 13890)
@@ -575,6 +575,20 @@
                                                                  P_("Place the scroll arrows on opposite sides of the menu."),
                                                                  FALSE,
                                                                  GTK_PARAM_READABLE));
+  /**
+   * GtkMenuItem::arrow-scaling
+   *
+   * Arbitrary constant to scale down the size of the scroll arrow.
+   *
+   * Since: maemo 4.0
+   * Stability: Unstable
+   */
+  gtk_widget_class_install_style_property (widget_class,
+                                           g_param_spec_float ("maemo-arrow-scaling",
+                                                               P_("Arrow Scaling"),
+                                                               P_("Amount of space used up by the scroll arrows, relative to scroll-arrow-vlength"),
+                                                               0.0, 1.0, 0.7,
+                                                               GTK_PARAM_READABLE));
 #endif
 
  gtk_container_class_install_child_property (container_class,
@@ -2681,7 +2695,12 @@
 
   if (event->window == widget->window)
     {
-      gint arrow_size = 0.7 * arrow_space;
+      gfloat arrow_scaling = 0.7;
+      gint arrow_size;
+#ifdef MAEMO_CHANGES
+      gtk_widget_style_get (widget, "maemo-arrow-scaling", &arrow_scaling, NULL);
+#endif
+      arrow_size = arrow_scaling * arrow_space;
 
       gtk_paint_box (widget->style,
 		     widget->window,


More information about the maemo-commits mailing list