diff -ur src/xfce_theme_draw.c src/xfce_theme_draw.c --- src/xfce_theme_draw.c 2011-01-16 16:40:26.000000000 +0100 +++ src/xfce_theme_draw.c 2011-02-26 01:02:27.928000005 +0100 @@ -505,6 +505,26 @@ g_return_if_fail(style != NULL); g_return_if_fail(window != NULL); + /* Spin buttons are a special case */ + if (widget && GTK_IS_SPIN_BUTTON(widget)) + { + /* GtkEntry doesn't provide the text area as frame size */ + if (DETAIL("entry")) + { + gint line_width = 0; + gboolean interior_focus; + gdk_drawable_get_size (GTK_ENTRY(widget)->text_area, &width, NULL); + if (!gtk_widget_has_focus(widget)) + gtk_widget_style_get (widget, + "focus-line-width", &line_width, + "interior-focus", &interior_focus, + NULL); + if (interior_focus) + line_width = 0; + width += (style->xthickness + line_width) * 2; + } + } + if (shadow_type == GTK_SHADOW_NONE) return; @@ -665,7 +685,7 @@ case GTK_SHADOW_OUT: if (XFCE_RC_STYLE(style->rc_style)->smooth_edge) { - if ((DETAIL("spinbutton_up") || DETAIL("spinbutton_up") || DETAIL("spinbutton_down")) && (state_type != GTK_STATE_PRELIGHT)) + if ((DETAIL("spinbutton_up") || DETAIL("spinbutton_down")) && (state_type != GTK_STATE_PRELIGHT)) { /* Do nothing */ } @@ -811,10 +831,6 @@ { /* Do nothing */ } - if ((DETAIL("spinbutton_up") || DETAIL("spinbutton_down")) && (state_type != GTK_STATE_PRELIGHT)) - { - /* Do nothing */ - } else if (DETAIL("menubar")) { if ((xt > 1) && (yt > 1)) @@ -1310,6 +1326,30 @@ } } +static void draw_focus(GtkStyle * style, GdkWindow * window, GtkStateType state_type, GdkRectangle * area, GtkWidget * widget, const gchar * detail, gint x, gint y, gint width, gint height) +{ + /* Spin buttons are a special case */ + if (widget && GTK_IS_SPIN_BUTTON(widget)) + { + /* GtkEntry doesn't provide the text area as focus size */ + if (DETAIL("entry")) + { + gint line_width = 0; + gboolean interior_focus; + gdk_drawable_get_size (GTK_ENTRY(widget)->text_area, &width, NULL); + gtk_widget_style_get (widget, + "focus-line-width", &line_width, + "interior-focus", &interior_focus, + NULL); + if (interior_focus) + line_width = 0; + width += (style->xthickness + line_width) * 2; + } + } + + parent_class->draw_focus(style, window, state_type, area, widget, detail, x, y, width, height); +} + static void draw_slider(GtkStyle * style, GdkWindow * window, GtkStateType state_type, GtkShadowType shadow_type, GdkRectangle * area, GtkWidget * widget, const gchar * detail, gint x, gint y, gint width, gint height, GtkOrientation orientation) { g_return_if_fail(style != NULL); @@ -1389,6 +1429,7 @@ style_class->draw_shadow_gap = draw_shadow_gap; style_class->draw_box_gap = draw_box_gap; style_class->draw_extension = draw_extension; + style_class->draw_focus = draw_focus; style_class->draw_slider = draw_slider; style_class->draw_handle = draw_handle; }