[Xfce4-commits] <gtk-xfce-engine:peter/refresh> Support trough-side-details.
Peter de Ridder
noreply at xfce.org
Sun Dec 15 22:12:02 CET 2013
Updating branch refs/heads/peter/refresh
to 8318ef51418fcf6d5707e6951dc1af7beab5e231 (commit)
from 7474743ceb1b9e066868517c8f98da033094d129 (commit)
commit 8318ef51418fcf6d5707e6951dc1af7beab5e231
Author: Peter de Ridder <peter at xfce.org>
Date: Sun Dec 15 19:44:52 2013 +0100
Support trough-side-details.
gtk-2.0/xfce_theme_draw.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/gtk-2.0/xfce_theme_draw.c b/gtk-2.0/xfce_theme_draw.c
index 6181356..3b1ea9a 100644
--- a/gtk-2.0/xfce_theme_draw.c
+++ b/gtk-2.0/xfce_theme_draw.c
@@ -107,6 +107,11 @@ static void xfce_fill_background(GtkStyle * style, GdkWindow * window, GtkStateT
cr = ge_gdk_drawable_to_cairo(window, area);
+ if (DETAIL("trough-lower"))
+ {
+ state_type = GTK_STATE_SELECTED;
+ }
+
if ((!draw_base) && (XFCE_RC_STYLE(style->rc_style)->gradient))
{
switch (XFCE_RC_STYLE(style->rc_style)->gradient_style)
@@ -143,7 +148,7 @@ static void xfce_fill_background(GtkStyle * style, GdkWindow * window, GtkStateT
}
break;
}
- if ((state_type == GTK_STATE_ACTIVE) || (DETAIL("trough")))
+ if ((state_type == GTK_STATE_ACTIVE) || (DETAIL("trough")) || (DETAIL("trough-lower")) || (DETAIL("trough-upper")))
{
shade_start = MIN (XFCE_RC_STYLE(style->rc_style)->shade_start, XFCE_RC_STYLE(style->rc_style)->shade_end);
shade_end = MAX (XFCE_RC_STYLE(style->rc_style)->shade_start, XFCE_RC_STYLE(style->rc_style)->shade_end);
@@ -493,9 +498,9 @@ static void draw_shadow(GtkStyle * style, GdkWindow * window, GtkStateType state
case GTK_SHADOW_IN:
if (XFCE_RC_STYLE(style->rc_style)->smooth_edge)
{
- if (DETAIL("trough"))
+ if (DETAIL("trough") || DETAIL("trough-lower") || DETAIL("trough-upper"))
{
- gdk_cairo_set_source_color(cr, &style->bg[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color(cr, &style->bg[DETAIL("trough-lower") ? GTK_STATE_SELECTED : GTK_STATE_NORMAL]);
cairo_rectangle(cr, x + 0.5, y + 0.5, width - 1, height - 1);
cairo_stroke(cr);
@@ -564,9 +569,9 @@ static void draw_shadow(GtkStyle * style, GdkWindow * window, GtkStateType state
}
else
{
- if (DETAIL("trough"))
+ if (DETAIL("trough") || DETAIL("trough-lower") || DETAIL("trough-upper"))
{
- gdk_cairo_set_source_color(cr, &style->dark[GTK_STATE_ACTIVE]);
+ gdk_cairo_set_source_color(cr, &style->dark[DETAIL("trough-lower") ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE]);
cairo_rectangle(cr, x + 0.5, y + 0.5, width - 1, height - 1);
cairo_stroke(cr);
}
More information about the Xfce4-commits
mailing list