diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-10-20 19:08:17 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-10-20 19:08:17 +0000 |
commit | 6a82d4c61f4061666d0e231cdbe2ab630a251908 (patch) | |
tree | 10b50dd41feff08dd06a44f217d1584065608c2b /gtk/gtkscrolledwindow.c | |
parent | 6117885c6d3cae28fc6f7ee64b627384fb0eb81e (diff) | |
download | gdk-pixbuf-6a82d4c61f4061666d0e231cdbe2ab630a251908.tar.gz |
Add a scrollbar_spacing style property (#81396, based on a patch from
Sun Oct 20 14:58:02 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_class_init):
Add a scrollbar_spacing style property (#81396, based
on a patch from Anders Carlsson)
Diffstat (limited to 'gtk/gtkscrolledwindow.c')
-rw-r--r-- | gtk/gtkscrolledwindow.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 3dde39a52..cc78baaa6 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -277,6 +277,15 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) GTK_SHADOW_NONE, G_PARAM_READABLE | G_PARAM_WRITABLE)); + gtk_widget_class_install_style_property (widget_class, + g_param_spec_int ("scrollbar_spacing", + _("Scrollbar spacing"), + _("Number of pixels between the scrollbars and the scrolled window"), + 0, + G_MAXINT, + DEFAULT_SCROLLBAR_SPACING, + G_PARAM_READABLE)); + signals[SCROLL_CHILD] = g_signal_new ("scroll_child", G_TYPE_FROM_CLASS (object_class), @@ -1384,6 +1393,16 @@ _gtk_scrolled_window_get_scrollbar_spacing (GtkScrolledWindow *scrolled_window) class = GTK_SCROLLED_WINDOW_GET_CLASS (scrolled_window); - return class->scrollbar_spacing >= 0 ? class->scrollbar_spacing : DEFAULT_SCROLLBAR_SPACING; -} + if (class->scrollbar_spacing >= 0) + return class->scrollbar_spacing; + else + { + gint scrollbar_spacing; + + gtk_widget_style_get (GTK_WIDGET (scrolled_window), + "scrollbar_spacing", &scrollbar_spacing, + NULL); + return scrollbar_spacing; + } +} |