[Xfce4-commits] <gtk-xfce-engine:master> Fixed rendering of inconsistent checkboxes (bug #7279)

Peter de Ridder noreply at xfce.org
Mon Feb 28 22:06:02 CET 2011


Updating branch refs/heads/master
         to d6b60ea674eb1c2bbc9c1ba1b5bb3b41b58500e2 (commit)
       from 229f602aa68eb0b6f87fd13acad4787083759120 (commit)

commit d6b60ea674eb1c2bbc9c1ba1b5bb3b41b58500e2
Author: Peter de Ridder <peter at xfce.org>
Date:   Mon Feb 28 22:00:44 2011 +0100

    Fixed rendering of inconsistent checkboxes (bug #7279)
    
    Draw a [-] (dash) for inconsistent checkboxes.

 src/xfce_theme_draw.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/xfce_theme_draw.c b/src/xfce_theme_draw.c
index baefbdc..8b472ca 100644
--- a/src/xfce_theme_draw.c
+++ b/src/xfce_theme_draw.c
@@ -65,6 +65,7 @@ typedef enum
     CHECK_BASE,
     CHECK_TEXT,
     CHECK_CROSS,
+    CHECK_DASH,
     RADIO_LIGHT,
     RADIO_DARK,
     RADIO_BASE,
@@ -99,6 +100,11 @@ static const guchar check_cross_bits[] = {
     0xf8, 0x00, 0x78, 0x00, 0x38, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
     0x00, 0x00,
 };
+static const guchar check_dash_bits[] = {
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03,
+    0xf8, 0x03, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00,
+};
 static const guchar radio_light_bits[] = {
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x08,
     0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x04, 0x08, 0x02, 0xf0, 0x01,
@@ -136,6 +142,7 @@ parts[] =
     { check_base_bits,  NULL },
     { check_text_bits,  NULL },
     { check_cross_bits, NULL },
+    { check_dash_bits,  NULL },
     { radio_light_bits, NULL },
     { radio_dark_bits,  NULL },
     { radio_base_bits,  NULL },
@@ -981,6 +988,10 @@ static void draw_check(GtkStyle * style, GdkWindow * window, GtkStateType state,
         {
             draw_part(window, style->fg_gc[state], area, x, y, CHECK_CROSS);
         }
+        else if (shadow == GTK_SHADOW_ETCHED_IN)
+        {
+            draw_part(window, style->fg_gc[state], area, x, y, CHECK_DASH);
+        }
     }
     else
     {
@@ -992,6 +1003,10 @@ static void draw_check(GtkStyle * style, GdkWindow * window, GtkStateType state,
         {
             draw_part(window, style->text_gc[state], area, x, y, CHECK_CROSS);
         }
+        else if (shadow == GTK_SHADOW_ETCHED_IN)
+        {
+            draw_part(window, style->fg_gc[state], area, x, y, CHECK_DASH);
+        }
     }
 }
 



More information about the Xfce4-commits mailing list