Commit fb12bbce authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

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.
parent 19063333
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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment