summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-12-02 18:59:59 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-12-02 18:59:59 -0500
commit09c74f958dd62cb3727ff152d1f77510f6eb5574 (patch)
treece33a27f49934912a6bb91da39ccc85b253521e8 /tests
parentb5bcc299adc1f32e6d1d4f332204399de89823f7 (diff)
downloadgtk+-09c74f958dd62cb3727ff152d1f77510f6eb5574.tar.gz
Add another hand-drawn scrollbar
This one is supposed to show up in active state, but doesn't.
Diffstat (limited to 'tests')
-rw-r--r--tests/foreigndrawing.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/foreigndrawing.c b/tests/foreigndrawing.c
index 5d274eab04..37056adb54 100644
--- a/tests/foreigndrawing.c
+++ b/tests/foreigndrawing.c
@@ -52,25 +52,26 @@ get_style (PathElt pelt[], gint n_elts)
}
static void
-draw_horizontal_scrollbar (GtkWidget *widget,
- cairo_t *cr,
- gint x,
- gint y,
- gint width,
- gint height,
- gint position)
+draw_horizontal_scrollbar (GtkWidget *widget,
+ cairo_t *cr,
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+ gint position,
+ GtkStateFlags state)
{
GtkStyleContext *context;
PathElt trough[2] = {
- { GTK_TYPE_SCROLLBAR, "scrollbar", "horizontal", GTK_STATE_FLAG_NORMAL },
- { G_TYPE_NONE, "trough", NULL, GTK_STATE_FLAG_NORMAL }
+ { GTK_TYPE_SCROLLBAR, "scrollbar", "horizontal", state },
+ { G_TYPE_NONE, "trough", NULL, state }
};
PathElt slider[3] = {
- { GTK_TYPE_SCROLLBAR, "scrollbar", "horizontal", GTK_STATE_FLAG_NORMAL },
- { G_TYPE_NONE, "trough", NULL, GTK_STATE_FLAG_NORMAL },
- { G_TYPE_NONE, "slider", NULL, GTK_STATE_FLAG_NORMAL }
+ { GTK_TYPE_SCROLLBAR, "scrollbar", "horizontal", state },
+ { G_TYPE_NONE, "trough", NULL, state },
+ { G_TYPE_NONE, "slider", NULL, state }
};
context = get_style (trough, G_N_ELEMENTS (trough));
@@ -95,7 +96,8 @@ draw_cb (GtkWidget *widget,
width = gtk_widget_get_allocated_width (widget);
- draw_horizontal_scrollbar (widget, cr, 10, 10, width - 20, 10, 30);
+ draw_horizontal_scrollbar (widget, cr, 10, 10, width - 20, 10, 30, GTK_STATE_FLAG_NORMAL);
+ draw_horizontal_scrollbar (widget, cr, 10, 30, width - 20, 10, 50, GTK_STATE_FLAG_PRELIGHT|GTK_STATE_FLAG_ACTIVE);
return FALSE;
}