mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 21:40:19 +00:00
added GtkArrow::arrow-scaling style property to control the arrow/border
Tue Sep 19 17:00:04 2006 Tim Janik <timj@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.
This commit is contained in:
parent
19063333ad
commit
fb12bbcebb
@ -1,3 +1,12 @@
|
||||
Tue Sep 19 17:00:04 2006 Tim Janik <timj@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.
|
||||
|
||||
2006-09-19 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkfilechooserdefault.c (update_current_folder_get_info_cb):
|
||||
|
@ -86,7 +86,13 @@ gtk_arrow_class_init (GtkArrowClass *class)
|
||||
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 sed up by arrow"),
|
||||
0.0, 1.0, 0.7,
|
||||
GTK_PARAM_READABLE));
|
||||
|
||||
widget_class->expose_event = gtk_arrow_expose;
|
||||
}
|
||||
|
||||
@ -204,8 +210,6 @@ static gboolean
|
||||
gtk_arrow_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GtkArrow *arrow;
|
||||
GtkMisc *misc;
|
||||
GtkShadowType shadow_type;
|
||||
gint width, height;
|
||||
gint x, y;
|
||||
@ -215,12 +219,14 @@ gtk_arrow_expose (GtkWidget *widget,
|
||||
|
||||
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;
|
||||
extent = MIN (width, height) * arrow_scaling;
|
||||
effective_arrow_type = arrow->arrow_type;
|
||||
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
||||
|
@ -2389,9 +2389,11 @@ create_handle_box (GtkWidget *widget)
|
||||
"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))
|
||||
|
@ -31,6 +31,7 @@ style "global-style-properties"
|
||||
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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user