[gtk+/gtk-style-context] GtkThemingEngine: Also render topright and bottomleft corners if junction sides say so
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context] GtkThemingEngine: Also render topright and bottomleft corners if junction sides say so
- Date: Wed, 24 Nov 2010 22:38:11 +0000 (UTC)
commit 5554d2bd5e220c24e0cb5db288890c6ad0c9e18e
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Nov 24 23:20:15 2010 +0100
GtkThemingEngine: Also render topright and bottomleft corners if junction sides say so
gtk/gtkthemingengine.c | 27 ++++++++++++++++-----------
1 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index e16dc03..63b27ba 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -1682,27 +1682,32 @@ render_frame_internal (GtkThemingEngine *engine,
junction);
cairo_stroke (cr);
- if (radius == 0 &&
- border_width > 1)
+ if (border_width > 1)
{
/* overprint top/right and bottom/left corner
- * triangles, to give the box a 3D-like appearance
+ * triangles if there are square corners there,
+ * to give the box a 3D-like appearance.
*/
+ cairo_save (cr);
+
if (border_style == GTK_BORDER_STYLE_INSET)
gdk_cairo_set_source_rgba (cr, &lighter);
else
gdk_cairo_set_source_rgba (cr, border_color);
- cairo_save (cr);
-
cairo_set_line_width (cr, 1);
- _cairo_corner_triangle (cr,
- x + width - border_width, y,
- border_width);
- _cairo_corner_triangle (cr,
- x, y + height - border_width,
- border_width);
+ if (radius == 0 ||
+ (junction & GTK_JUNCTION_CORNER_TOPRIGHT) != 0)
+ _cairo_corner_triangle (cr,
+ x + width - border_width, y,
+ border_width);
+
+ if (radius == 0 ||
+ (junction & GTK_JUNCTION_CORNER_BOTTOMLEFT) != 0)
+ _cairo_corner_triangle (cr,
+ x, y + height - border_width,
+ border_width);
cairo_stroke (cr);
cairo_restore (cr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]