1 --- gtk+-2.6.4/gtk/gtkprogressbar.c 2005-01-09 19:32:25.000000000 +0200
2 +++ gtk+-2.6.4/gtk/gtkprogressbar.c 2005-04-06 16:19:37.112896344 +0300
6 #define MIN_HORIZONTAL_BAR_WIDTH 150
7 -#define MIN_HORIZONTAL_BAR_HEIGHT 20
8 +#define MIN_HORIZONTAL_BAR_HEIGHT 30 /* OSSO mod. was 20 */
9 #define MIN_VERTICAL_BAR_WIDTH 22
10 #define MIN_VERTICAL_BAR_HEIGHT 80
11 #define MAX_TEXT_LENGTH 80
12 -#define TEXT_SPACING 2
13 +#define DEFAULT_TEXT_SPACING 2 /* OSSO mod. Changed from
14 + * TEXT_SPACING. Now controlled
15 + * by "text-spacing" style
17 +#define DEFAULT_WIDTH_INCREMENT 3
18 +#define DEFAULT_HEIGHT_INCREMENT 3
19 +#define DEFAULT_TEXT_XNUDGE 1
20 +#define DEFAULT_TEXT_YNUDGE 1
28 + /* OSSO addition. */
29 + gtk_widget_class_install_style_property (widget_class,
30 + g_param_spec_int ("text-spacing",
32 + "The amount of pixels between the trough and text.",
35 + DEFAULT_TEXT_SPACING,
36 + G_PARAM_READWRITE));
38 + gtk_widget_class_install_style_property (widget_class,
39 + g_param_spec_int ("width-increment",
41 + "The amount of pixels to add to the width size request.",
44 + DEFAULT_WIDTH_INCREMENT,
45 + G_PARAM_READWRITE));
47 + gtk_widget_class_install_style_property (widget_class,
48 + g_param_spec_int ("height-increment",
50 + "The amount of pixels to add to the height size request.",
53 + DEFAULT_WIDTH_INCREMENT,
54 + G_PARAM_READWRITE));
56 + gtk_widget_class_install_style_property (widget_class,
57 + g_param_spec_int ("text-xnudge",
59 + "Amount of pixels to move the text x position.",
62 + DEFAULT_TEXT_XNUDGE,
63 + G_PARAM_READWRITE));
65 + gtk_widget_class_install_style_property (widget_class,
66 + g_param_spec_int ("text-ynudge",
68 + "Amount of pixels to move the text y position.",
71 + DEFAULT_TEXT_YNUDGE,
72 + G_PARAM_READWRITE));
80 - pbar = gtk_widget_new (GTK_TYPE_PROGRESS_BAR, NULL);
81 + pbar = gtk_widget_new (GTK_TYPE_PROGRESS_BAR,
82 + "text-xalign", 0.0, /* OSSO addition. */
88 PangoRectangle logical_rect;
92 + gint width_increment, height_increment;
94 g_return_if_fail (GTK_IS_PROGRESS_BAR (widget));
95 g_return_if_fail (requisition != NULL);
97 + gtk_widget_style_get (widget,
98 + "text-spacing", &text_spacing,
99 + "width-increment", &width_increment,
100 + "height-increment", &height_increment,
103 progress = GTK_PROGRESS (widget);
104 pbar = GTK_PROGRESS_BAR (widget);
106 - width = 2 * widget->style->xthickness + 3 + 2 * TEXT_SPACING;
107 - height = 2 * widget->style->ythickness + 3 + 2 * TEXT_SPACING;
108 + width = 2 * widget->style->xthickness + width_increment + 2 * text_spacing;
109 + height = 2 * widget->style->ythickness + height_increment + 2 * text_spacing;
111 if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE)
114 PangoRectangle logical_rect;
115 GdkRectangle prelight_clip, normal_clip;
117 + gint text_xnudge, text_ynudge;
119 + gtk_widget_style_get (widget,
120 + "text-xnudge", &text_xnudge,
121 + "text-ynudge", &text_ynudge,
124 buf = gtk_progress_get_current_text (progress);
126 layout = gtk_widget_create_pango_layout (widget, buf);
127 @@ -789,12 +858,12 @@
129 pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
131 - x = widget->style->xthickness + 1 +
132 + x = widget->style->xthickness + text_xnudge +
133 (widget->allocation.width - 2 * widget->style->xthickness -
134 2 - logical_rect.width)
137 - y = widget->style->ythickness + 1 +
138 + y = widget->style->ythickness + text_ynudge +
139 (widget->allocation.height - 2 * widget->style->ythickness -
140 2 - logical_rect.height)