1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 * Copyright (C) 2001 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
23 * file for a list of people on the GTK+ Team. See the ChangeLog
24 * files for a list of changes. These files are distributed with
25 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
29 #include "gtkscrollbar.h"
31 #include "gtkprivate.h"
34 static void gtk_scrollbar_style_set (GtkWidget *widget,
37 G_DEFINE_ABSTRACT_TYPE (GtkScrollbar, gtk_scrollbar, GTK_TYPE_RANGE)
40 gtk_scrollbar_class_init (GtkScrollbarClass *class)
42 GtkWidgetClass *widget_class;
44 widget_class = GTK_WIDGET_CLASS (class);
46 widget_class->style_set = gtk_scrollbar_style_set;
48 gtk_widget_class_install_style_property (widget_class,
49 g_param_spec_int ("min-slider-length",
50 P_("Minimum Slider Length"),
51 P_("Minimum length of scrollbar slider"),
57 gtk_widget_class_install_style_property (widget_class,
58 g_param_spec_boolean ("fixed-slider-length",
59 P_("Fixed slider size"),
60 P_("Don't change slider size, just lock it to the minimum length"),
65 gtk_widget_class_install_style_property (widget_class,
66 g_param_spec_boolean ("has-backward-stepper",
67 P_("Backward stepper"),
68 P_("Display the standard backward arrow button"),
73 gtk_widget_class_install_style_property (widget_class,
74 g_param_spec_boolean ("has-forward-stepper",
75 P_("Forward stepper"),
76 P_("Display the standard forward arrow button"),
81 gtk_widget_class_install_style_property (widget_class,
82 g_param_spec_boolean ("has-secondary-backward-stepper",
83 P_("Secondary backward stepper"),
84 P_("Display a second backward arrow button on the opposite end of the scrollbar"),
89 gtk_widget_class_install_style_property (widget_class,
90 g_param_spec_boolean ("has-secondary-forward-stepper",
91 P_("Secondary forward stepper"),
92 P_("Display a second forward arrow button on the opposite end of the scrollbar"),
99 gtk_scrollbar_init (GtkScrollbar *scrollbar)
104 gtk_scrollbar_style_set (GtkWidget *widget,
109 gboolean has_a, has_b, has_c, has_d;
112 range = GTK_RANGE (widget);
114 gtk_widget_style_get (widget,
115 "min-slider-length", &slider_length,
116 "fixed-slider-length", &fixed_size,
117 "has-backward-stepper", &has_a,
118 "has-secondary-forward-stepper", &has_b,
119 "has-secondary-backward-stepper", &has_c,
120 "has-forward-stepper", &has_d,
123 range->min_slider_size = slider_length;
124 range->slider_size_fixed = fixed_size;
126 range->has_stepper_a = has_a;
127 range->has_stepper_b = has_b;
128 range->has_stepper_c = has_c;
129 range->has_stepper_d = has_d;
131 (* GTK_WIDGET_CLASS (gtk_scrollbar_parent_class)->style_set) (widget, previous);
134 #define __GTK_SCROLLBAR_C__
135 #include "gtkaliasdef.c"