Bug 538782 – Make GtkMenu's arrow size themable

* gtk/gtkmenu.c (gtk_menu_class_init), (gtk_menu_paint):
Implement "arrow-scaling" style property in GtkMenu.

svn path=/trunk/; revision=21509
This commit is contained in:
Christian Dywan 2008-09-24 08:56:10 +00:00
parent 3a872a3c42
commit 9da63118e1
2 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2008-09-24 Christian Dywan <christian@imendio.com>
Bug 538782 Make GtkMenu's arrow size themable
* gtk/gtkmenu.c (gtk_menu_class_init), (gtk_menu_paint):
Implement "arrow-scaling" style property in GtkMenu.
2008-09-24 Christian Dywan <christian@imendio.com>
Bug 408244 add GtkDialog::content-area-spacing

View File

@ -661,6 +661,20 @@ gtk_menu_class_init (GtkMenuClass *class)
-1, INT_MAX, -1,
GTK_PARAM_READWRITE));
/**
* GtkMenu::arrow-scaling
*
* Arbitrary constant to scale down the size of the scroll arrow.
*
* Since: 2.16
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_float ("arrow-scaling",
P_("Arrow Scaling"),
P_("Arbitrary constant to scale down the size of the scroll arrow"),
0.0, 1.0, 0.7,
GTK_PARAM_READABLE));
binding_set = gtk_binding_set_by_class (class);
gtk_binding_entry_add_signal (binding_set,
GDK_Up, 0,
@ -2626,7 +2640,11 @@ gtk_menu_paint (GtkWidget *widget,
if (event->window == widget->window)
{
gint arrow_size = 0.7 * arrow_space;
gfloat arrow_scaling;
gint arrow_size;
gtk_widget_style_get (widget, "arrow-scaling", &arrow_scaling, NULL);
arrow_size = arrow_scaling * arrow_space;
gtk_paint_box (widget->style,
widget->window,