summaryrefslogtreecommitdiff
path: root/gtk/gtkrange.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-02-27 22:41:33 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-02-27 22:41:33 +0000
commit9cbf37990b543d07a63971b6a3b9d02b3ded7046 (patch)
tree2e131e268caf0bd43e8e68c3660ed15487804b73 /gtk/gtkrange.c
parent27b1d120e8ea780749cbecbbdd0afe4b2b29a4b2 (diff)
downloadgdk-pixbuf-9cbf37990b543d07a63971b6a3b9d02b3ded7046.tar.gz
if CAN_FOCUS reserve focus_line_width + focus_line_pad extra space and
Wed Feb 27 17:32:09 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkrange.c (gtk_range_get_props): if CAN_FOCUS reserve focus_line_width + focus_line_pad extra space and draw the focus in that space. #72027.
Diffstat (limited to 'gtk/gtkrange.c')
-rw-r--r--gtk/gtkrange.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 9cb0998d5..e6d216680 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -927,9 +927,19 @@ gtk_range_expose (GtkWidget *widget,
GtkStateType state;
GdkRectangle expose_area; /* Relative to widget->allocation */
GdkRectangle area;
+ gint focus_line_width = 0;
+ gint focus_padding = 0;
range = GTK_RANGE (widget);
+ if (GTK_WIDGET_CAN_FOCUS (range))
+ {
+ gtk_widget_style_get (GTK_WIDGET (range),
+ "focus-line-width", &focus_line_width,
+ "focus-padding", &focus_padding,
+ NULL);
+ }
+
expose_area = event->area;
expose_area.x -= widget->allocation.x;
expose_area.y -= widget->allocation.y;
@@ -956,10 +966,10 @@ gtk_range_expose (GtkWidget *widget,
sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
GTK_SHADOW_IN,
&area, GTK_WIDGET(range), "trough",
- widget->allocation.x + range->range_rect.x,
- widget->allocation.y + range->range_rect.y,
- range->range_rect.width,
- range->range_rect.height);
+ widget->allocation.x + range->range_rect.x + focus_line_width + focus_padding,
+ widget->allocation.y + range->range_rect.y + focus_line_width + focus_padding,
+ range->range_rect.width - 2 * (focus_line_width + focus_padding),
+ range->range_rect.height - 2 * (focus_line_width + focus_padding));
if (sensitive &&
@@ -1630,6 +1640,19 @@ gtk_range_get_props (GtkRange *range,
"arrow_displacement_y", &tmp_arrow_displacement_y,
NULL);
+ if (GTK_WIDGET_CAN_FOCUS (range))
+ {
+ gint focus_line_width;
+ gint focus_padding;
+
+ gtk_widget_style_get (GTK_WIDGET (range),
+ "focus-line-width", &focus_line_width,
+ "focus-padding", &focus_padding,
+ NULL);
+
+ tmp_trough_border += focus_line_width + focus_padding;
+ }
+
if (slider_width)
*slider_width = tmp_slider_width;
@@ -1800,7 +1823,7 @@ gtk_range_calc_request (GtkRange *range,
{
gint slider_length;
gint n_steppers;
-
+
border->left = 0;
border->right = 0;
border->top = 0;