Bug 429427 – Add "arrow-spacing" style property to GtkRange
2008-08-02 Matthias Clasen <mclasen@redhat.com> Bug 429427 – Add "arrow-spacing" style property to GtkRange * gtk/gtkrange.c: Add an arrow-spacing style property. Patch by Carlos Garnacho and Christian Dywan svn path=/trunk/; revision=20939
This commit is contained in:
parent
7d88f59fad
commit
5b980c221a
@ -1,3 +1,10 @@
|
|||||||
|
2008-08-02 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Bug 429427 – Add "arrow-spacing" style property to GtkRange
|
||||||
|
|
||||||
|
* gtk/gtkrange.c: Add an arrow-spacing style property.
|
||||||
|
Patch by Carlos Garnacho and Christian Dywan
|
||||||
|
|
||||||
2008-08-02 Matthias Clasen <mclasen@redhat.com>
|
2008-08-02 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
Bug 429411 – add style properties to set minimum progressbar
|
Bug 429411 – add style properties to set minimum progressbar
|
||||||
|
@ -522,6 +522,20 @@ gtk_range_class_init (GtkRangeClass *class)
|
|||||||
TRUE,
|
TRUE,
|
||||||
GTK_PARAM_READABLE));
|
GTK_PARAM_READABLE));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GtkRange:arrow-scaling:
|
||||||
|
*
|
||||||
|
* The arrow size proportion relative to the scroll button size.
|
||||||
|
*
|
||||||
|
* Since: 2.14
|
||||||
|
*/
|
||||||
|
gtk_widget_class_install_style_property (widget_class,
|
||||||
|
g_param_spec_float ("arrow-scaling",
|
||||||
|
P_("Arrow scaling"),
|
||||||
|
P_("Arrow scaling with regard to scroll button size"),
|
||||||
|
0.0, 1.0, 0.5,
|
||||||
|
GTK_PARAM_READABLE));
|
||||||
|
|
||||||
g_type_class_add_private (class, sizeof (GtkRangeLayout));
|
g_type_class_add_private (class, sizeof (GtkRangeLayout));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1324,6 +1338,7 @@ draw_stepper (GtkRange *range,
|
|||||||
GtkShadowType shadow_type;
|
GtkShadowType shadow_type;
|
||||||
GdkRectangle intersection;
|
GdkRectangle intersection;
|
||||||
GtkWidget *widget = GTK_WIDGET (range);
|
GtkWidget *widget = GTK_WIDGET (range);
|
||||||
|
gfloat arrow_scaling;
|
||||||
|
|
||||||
gint arrow_x;
|
gint arrow_x;
|
||||||
gint arrow_y;
|
gint arrow_y;
|
||||||
@ -1375,8 +1390,10 @@ draw_stepper (GtkRange *range,
|
|||||||
rect->width,
|
rect->width,
|
||||||
rect->height);
|
rect->height);
|
||||||
|
|
||||||
arrow_width = rect->width / 2;
|
gtk_widget_style_get (widget, "arrow-scaling", &arrow_scaling, NULL);
|
||||||
arrow_height = rect->height / 2;
|
|
||||||
|
arrow_width = rect->width * arrow_scaling;
|
||||||
|
arrow_height = rect->height * arrow_scaling;
|
||||||
arrow_x = widget->allocation.x + rect->x + (rect->width - arrow_width) / 2;
|
arrow_x = widget->allocation.x + rect->x + (rect->width - arrow_width) / 2;
|
||||||
arrow_y = widget->allocation.y + rect->y + (rect->height - arrow_height) / 2;
|
arrow_y = widget->allocation.y + rect->y + (rect->height - arrow_height) / 2;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user