[gimp] app/display: introduce a style for dimming



commit dd1e858921db451e13658f91349d78c6eda2abdf
Author: Sven Neumann <sven gimp org>
Date:   Tue Sep 28 22:10:33 2010 +0200

    app/display: introduce a style for dimming

 app/display/gimpdisplayshell-draw.c  |    3 +--
 app/display/gimpdisplayshell-style.c |   15 ++++++++++++---
 app/display/gimpdisplayshell-style.h |    4 ++++
 3 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c
index b1cf61c..bea12f0 100644
--- a/app/display/gimpdisplayshell-draw.c
+++ b/app/display/gimpdisplayshell-draw.c
@@ -811,7 +811,6 @@ gimp_display_shell_draw_highlight (GimpDisplayShell *shell,
   cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
   cairo_clip (cr);
 
-  /*  FIXME: make this configurable or at least use gimpdisplayshell-style.c  */
-  cairo_set_source_rgba (cr, 0, 0, 0, 0.5);
+  gimp_display_shell_set_dim_style (shell, cr);
   cairo_paint (cr);
 }
diff --git a/app/display/gimpdisplayshell-style.c b/app/display/gimpdisplayshell-style.c
index 754a675..7d51232 100644
--- a/app/display/gimpdisplayshell-style.c
+++ b/app/display/gimpdisplayshell-style.c
@@ -20,8 +20,6 @@
 
 #include "config.h"
 
-#include <string.h>
-
 #include <gegl.h>
 #include <gtk/gtk.h>
 
@@ -69,6 +67,8 @@ static const GimpRGB vectors_normal_fg   = { 0.0, 0.0, 1.0, 0.8 };
 static const GimpRGB vectors_active_bg   = { 1.0, 1.0, 1.0, 0.6 };
 static const GimpRGB vectors_active_fg   = { 1.0, 0.0, 0.0, 0.8 };
 
+static const GimpRGB dim                 = { 0.0, 0.0, 0.0, 0.5 };
+
 static const GimpRGB tool_bg             = { 0.0, 0.0, 0.0, 0.4 };
 static const GimpRGB tool_fg             = { 1.0, 1.0, 1.0, 0.8 };
 static const GimpRGB tool_fg_highlight   = { 1.0, 0.8, 0.2, 0.8 };
@@ -324,6 +324,16 @@ gimp_display_shell_set_vectors_fg_style (GimpDisplayShell *shell,
 }
 
 void
+gimp_display_shell_set_dim_style (GimpDisplayShell *shell,
+                                  cairo_t          *cr)
+{
+  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+  g_return_if_fail (cr != NULL);
+
+  gimp_cairo_set_source_rgba (cr, &dim);
+}
+
+void
 gimp_display_shell_set_tool_bg_style (GimpDisplayShell *shell,
                                       cairo_t          *cr)
 {
@@ -341,7 +351,6 @@ gimp_display_shell_set_tool_fg_style (GimpDisplayShell *shell,
                                       cairo_t          *cr,
                                       gboolean          highlight)
 {
-  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
   g_return_if_fail (cr != NULL);
 
   cairo_set_line_width (cr, 1.0);
diff --git a/app/display/gimpdisplayshell-style.h b/app/display/gimpdisplayshell-style.h
index a450a3c..3d0ab18 100644
--- a/app/display/gimpdisplayshell-style.h
+++ b/app/display/gimpdisplayshell-style.h
@@ -54,6 +54,10 @@ void   gimp_display_shell_set_vectors_fg_style    (GimpDisplayShell *shell,
                                                    cairo_t          *cr,
                                                    gdouble           width,
                                                    gboolean          active);
+
+void   gimp_display_shell_set_dim_style           (GimpDisplayShell *shell,
+                                                   cairo_t          *cr);
+
 void   gimp_display_shell_set_tool_bg_style       (GimpDisplayShell *shell,
                                                    cairo_t          *cr);
 void   gimp_display_shell_set_tool_fg_style       (GimpDisplayShell *shell,



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