X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkhsv.c;h=6266b4f17d040f2f3f11fe0db4e990c59985d3a4;hb=c070e7acf50f1a5e87b78b7b47cc894d04ed81c2;hp=ea133aaa58408f972c7919d981d0f89cef646128;hpb=af00ca81e1787ce59e10cd21b8ee49a246256958;p=~andy%2Fgtk diff --git a/gtk/gtkhsv.c b/gtk/gtkhsv.c index ea133aaa5..6266b4f17 100644 --- a/gtk/gtkhsv.c +++ b/gtk/gtkhsv.c @@ -862,13 +862,6 @@ paint_ring (GtkHSV *hsv, cairo_surface_t *source; cairo_t *source_cr; gint stride; - gint focus_width; - gint focus_pad; - - gtk_widget_style_get (widget, - "focus-line-width", &focus_width, - "focus-padding", &focus_pad, - NULL); width = gtk_widget_get_allocated_width (widget); height = gtk_widget_get_allocated_height (widget); @@ -993,8 +986,9 @@ get_color (gdouble h, /* Paints the HSV triangle */ static void -paint_triangle (GtkHSV *hsv, - cairo_t *cr) +paint_triangle (GtkHSV *hsv, + cairo_t *cr, + gboolean draw_focus) { GtkHSVPrivate *priv = hsv->priv; GtkWidget *widget = GTK_WIDGET (hsv); @@ -1182,8 +1176,7 @@ paint_triangle (GtkHSV *hsv, /* Draw focus outline */ - if (gtk_widget_has_focus (widget) && - !priv->focus_on_ring) + if (draw_focus && !priv->focus_on_ring) { gint focus_width; gint focus_pad; @@ -1205,16 +1198,20 @@ paint_triangle (GtkHSV *hsv, /* Paints the contents of the HSV color selector */ static gboolean -gtk_hsv_draw (GtkWidget *widget, - cairo_t *cr) +gtk_hsv_draw (GtkWidget *widget, + cairo_t *cr) { GtkHSV *hsv = GTK_HSV (widget); GtkHSVPrivate *priv = hsv->priv; + gboolean draw_focus; + + draw_focus = gtk_widget_has_visible_focus (widget); paint_ring (hsv, cr); - paint_triangle (hsv, cr); + paint_triangle (hsv, cr, draw_focus); + - if (gtk_widget_has_focus (widget) && priv->focus_on_ring) + if (draw_focus && priv->focus_on_ring) { GtkStyleContext *context; GtkStateFlags state;