[dia/dia-0-97] Part of bug #599447 - High Contrast Black & Inaccessible Widgets



commit fbecf0bdb443f6cb5cc3f54331e8dbada88a5c63
Author: Hans Breuer <hans breuer org>
Date:   Sat Nov 7 16:30:23 2009 +0100

    Part of bug #599447 - High Contrast Black & Inaccessible Widgets
    
    DiaArrowChooser was wrongly using hardcoded black/white for rendering.
    Now it is switched to widget colors to be consistent with
    DiaLineChooser and useable with dark themes.
    (cherry picked from commit 89287cf7b7c106f03af01b2dc1d769a37e83a484)

 lib/diaarrowchooser.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/lib/diaarrowchooser.c b/lib/diaarrowchooser.c
index 7a45573..e42217f 100644
--- a/lib/diaarrowchooser.c
+++ b/lib/diaarrowchooser.c
@@ -215,12 +215,21 @@ dia_arrow_preview_expose(GtkWidget *widget, GdkEventExpose *event)
     renderer_pixmap_set_pixmap(renderer, win, x, y, width, height);
     renderer_ops->begin_render(renderer);
     renderer_ops->set_linewidth(renderer, linewidth);
-    renderer_ops->draw_line(renderer, &from, &to, &color_black);
-    arrow_draw (renderer, arrow_type.type, 
-                &arrow_head, &from, 
-		arrow_type.length, 
-		arrow_type.width,
-                linewidth, &color_black, &color_white);
+    {
+      Color color_bg, color_fg;
+      /* the text colors are the best approximation to what we had */
+      GdkColor bg = widget->style->base[GTK_WIDGET_STATE(widget)];
+      GdkColor fg = widget->style->text[GTK_WIDGET_STATE(widget)];
+
+      GDK_COLOR_TO_DIA(bg, color_bg);
+      GDK_COLOR_TO_DIA(fg, color_fg);
+      renderer_ops->draw_line(renderer, &from, &to, &color_fg);
+      arrow_draw (renderer, arrow_type.type, 
+                  &arrow_head, &from, 
+		  arrow_type.length, 
+		  arrow_type.width,
+                  linewidth, &color_fg, &color_bg);
+    }
     renderer_ops->end_render(renderer);
     g_object_unref(renderer);
   }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]