summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-10-07 23:50:33 +0200
committerBenjamin Otte <otte@redhat.com>2014-10-08 05:20:30 +0200
commit3c50c0988ae8b2713f86d0533b64527dae6c2168 (patch)
tree8defce0a4b0e5ea333665bfb444838f41b3708d1
parentc39bd623f648dab0da290fbe9b3a3bafde20fd21 (diff)
downloadgtk+-3c50c0988ae8b2713f86d0533b64527dae6c2168.tar.gz
render: Overhaul gtk_render_handle()
The code did weird things with drawing backgrounds sometimes but not really. Now it does this: (1) render a background (2) render a frame (3) render an icon - if no icon exists, draw the generic handle icon
-rw-r--r--gtk/gtkrender.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c
index 2f3f542209..28487bde5f 100644
--- a/gtk/gtkrender.c
+++ b/gtk/gtkrender.c
@@ -1725,9 +1725,10 @@ gtk_do_render_handle (GtkStyleContext *context,
const GdkRGBA *bg_color;
GdkRGBA lighter, darker;
GtkJunctionSides sides;
- GtkThemingBackground bg;
gint xx, yy;
- gboolean has_image;
+
+ gtk_render_background (context, cr, x, y, width, height);
+ gtk_render_frame (context, cr, x, y, width, height);
if (render_icon_image (context, cr, x, y, width, height))
return;
@@ -1741,12 +1742,6 @@ gtk_do_render_handle (GtkStyleContext *context,
color_shade (bg_color, 0.7, &darker);
color_shade (bg_color, 1.3, &lighter);
- _gtk_theming_background_init (&bg, context, x, y, width, height, sides);
- has_image = _gtk_theming_background_has_background_image (&bg);
- _gtk_theming_background_render (&bg, cr);
-
- gtk_do_render_frame (context, cr, x, y, width, height);
-
if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_GRIP))
{
/* reduce confusing values to a meaningful state */
@@ -1996,15 +1991,12 @@ gtk_do_render_handle (GtkStyleContext *context,
}
else if (gtk_style_context_has_class (context, GTK_STYLE_CLASS_PANE_SEPARATOR))
{
- if (!has_image)
- {
- if (width > height)
- for (xx = x + width / 2 - 15; xx <= x + width / 2 + 15; xx += 5)
- render_dot (cr, &lighter, &darker, xx, y + height / 2 - 1, 3);
- else
- for (yy = y + height / 2 - 15; yy <= y + height / 2 + 15; yy += 5)
- render_dot (cr, &lighter, &darker, x + width / 2 - 1, yy, 3);
- }
+ if (width > height)
+ for (xx = x + width / 2 - 15; xx <= x + width / 2 + 15; xx += 5)
+ render_dot (cr, &lighter, &darker, xx, y + height / 2 - 1, 3);
+ else
+ for (yy = y + height / 2 - 15; yy <= y + height / 2 + 15; yy += 5)
+ render_dot (cr, &lighter, &darker, x + width / 2 - 1, yy, 3);
}
else
{