[Xfce4-commits] [xfce/gtk-xfce-engine] 06/08: Use smooth_edge in focus line too.

noreply at xfce.org noreply at xfce.org
Fri Feb 6 22:24:22 CET 2015


This is an automated email from the git hooks/post-receive script.

peter pushed a commit to branch peter/refresh-gtk2
in repository xfce/gtk-xfce-engine.

commit 21367f9422bca8f0f80c4eb195a8eab69ff9c9da
Author: Peter de Ridder <peter at xfce.org>
Date:   Sun Jan 5 15:19:00 2014 +0100

    Use smooth_edge in focus line too.
---
 src/xfce_theme_draw.c |   63 +++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 50 insertions(+), 13 deletions(-)

diff --git a/src/xfce_theme_draw.c b/src/xfce_theme_draw.c
index f2a4abd..3c5070e 100644
--- a/src/xfce_theme_draw.c
+++ b/src/xfce_theme_draw.c
@@ -1776,14 +1776,21 @@ static void draw_focus(GtkStyle * style, GdkWindow * window, GtkStateType state_
             total_length += dash_list[i];
         }
 
-        /* The dash offset here aligns the pattern to integer pixels
-         * by starting the dash at the right side of the left border
-         * Negative dash offsets in cairo don't work
-         * (https://bugs.freedesktop.org/show_bug.cgi?id=2729)
-         */
-        dash_offset = - line_width / 2.;
-        while (dash_offset < 0)
-            dash_offset += total_length;
+        if (XFCE_RC_STYLE(style->rc_style)->smooth_edge)
+        {
+          dash_offset = 0;
+        }
+        else
+        {
+            /* The dash offset here aligns the pattern to integer pixels
+             * by starting the dash at the right side of the left border
+             * Negative dash offsets in cairo don't work
+             * (https://bugs.freedesktop.org/show_bug.cgi?id=2729)
+             */
+            dash_offset = - line_width / 2.;
+            while (dash_offset < 0)
+                dash_offset += total_length;
+        }
 
         cairo_set_dash (cr, dashes, n_dashes, dash_offset);
         g_free (dashes);
@@ -1795,11 +1802,41 @@ static void draw_focus(GtkStyle * style, GdkWindow * window, GtkStateType state_
         cairo_clip (cr);
     }
 
-    cairo_rectangle (cr,
-            x + line_width / 2.,
-            y + line_width / 2.,
-            width - line_width,
-            height - line_width);
+    if (XFCE_RC_STYLE(style->rc_style)->smooth_edge)
+    {
+        cairo_move_to (cr,
+                x + 1,
+                y + line_width / 2.);
+        cairo_line_to (cr,
+                x + width - 1,
+                y + line_width / 2.);
+        cairo_move_to (cr,
+                x + width - line_width / 2.,
+                y + 1);
+        cairo_line_to (cr,
+                x + width - line_width / 2.,
+                y + height - 1);
+        cairo_move_to (cr,
+                x + width - 1,
+                y + height - line_width / 2.);
+        cairo_line_to (cr,
+                x + 1,
+                y + height - line_width / 2.);
+        cairo_move_to (cr,
+                x + line_width / 2.,
+                y + height - 1);
+        cairo_line_to (cr,
+                x + line_width / 2.,
+                y + 1);
+    }
+    else
+    {
+        cairo_rectangle (cr,
+                x + line_width / 2.,
+                y + line_width / 2.,
+                width - line_width,
+                height - line_width);
+    }
     cairo_stroke (cr);
     cairo_destroy (cr);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list