[gimp/gimp-2-10] app: add standard highlight colors to gimphighlightablebutton.h



commit 28ad1d0eba6c0185170170aee332f9b7284f1f95
Author: Ell <ell_se yahoo com>
Date:   Sun Sep 2 01:37:10 2018 -0400

    app: add standard highlight colors to gimphighlightablebutton.h
    
    We're currently only using GimpHighlightableButton in the layers
    dialog, which defines its own set of highlight colors.  We're going
    to use highlightable buttons in the dashboard too, so let's move
    the highlight colors to gimphighlightablebutton.h, and give them
    standard names.  We currently define
    GIMP_HIGHLIGHTABLE_BUTTON_COLOR_AFFIRMATIVE (green), and
    GIMP_HIGHLIGHTABLE_BUTTON_COLOR_NEGATIVE (red).
    
    (This commit was accidentally dropped from the gimp-2-10 branch; it
    should have gone before 40ac4f7bc0f43aee24dc7ae1cf674d1a59612f55.)

 app/widgets/gimphighlightablebutton.h |  4 ++++
 app/widgets/gimplayertreeview.c       | 10 +++-------
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/app/widgets/gimphighlightablebutton.h b/app/widgets/gimphighlightablebutton.h
index 4e4c790725..a9283acfbc 100644
--- a/app/widgets/gimphighlightablebutton.h
+++ b/app/widgets/gimphighlightablebutton.h
@@ -30,6 +30,10 @@
 #define GIMP_HIGHLIGHTABLE_BUTTON_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), 
GIMP_TYPE_HIGHLIGHTABLE_BUTTON, GimpHighlightableButtonClass))
 
 
+#define GIMP_HIGHLIGHTABLE_BUTTON_COLOR_AFFIRMATIVE (&(const GimpRGB) {0.20, 0.70, 0.20, 0.65})
+#define GIMP_HIGHLIGHTABLE_BUTTON_COLOR_NEGATIVE    (&(const GimpRGB) {0.80, 0.20, 0.20, 0.65})
+
+
 typedef struct _GimpHighlightableButtonPrivate GimpHighlightableButtonPrivate;
 typedef struct _GimpHighlightableButtonClass   GimpHighlightableButtonClass;
 
diff --git a/app/widgets/gimplayertreeview.c b/app/widgets/gimplayertreeview.c
index da508ebe5f..80524c9e7d 100644
--- a/app/widgets/gimplayertreeview.c
+++ b/app/widgets/gimplayertreeview.c
@@ -64,10 +64,6 @@
 #include "gimp-intl.h"
 
 
-#define HIGHLIGHT_COLOR_GREEN {0.20, 0.70, 0.20, 0.65}
-#define HIGHLIGHT_COLOR_RED   {0.80, 0.20, 0.20, 0.65}
-
-
 struct _GimpLayerTreeViewPriv
 {
   GtkWidget       *layer_mode_box;
@@ -352,10 +348,10 @@ gimp_layer_tree_view_constructed (GObject *object)
 
   gimp_highlightable_button_set_highlight_color (
     GIMP_HIGHLIGHTABLE_BUTTON (gimp_item_tree_view_get_new_button (item_view)),
-    &(GimpRGB) HIGHLIGHT_COLOR_GREEN);
+    GIMP_HIGHLIGHTABLE_BUTTON_COLOR_AFFIRMATIVE);
   gimp_highlightable_button_set_highlight_color (
     GIMP_HIGHLIGHTABLE_BUTTON (gimp_item_tree_view_get_delete_button (item_view)),
-    &(GimpRGB) HIGHLIGHT_COLOR_RED);
+    GIMP_HIGHLIGHTABLE_BUTTON_COLOR_NEGATIVE);
 
   layer_view->priv->mask_cell = gimp_cell_renderer_viewable_new ();
   gtk_tree_view_column_pack_start (tree_view->main_column,
@@ -400,7 +396,7 @@ gimp_layer_tree_view_constructed (GObject *object)
   layer_view->priv->anchor_button = button;
   gimp_highlightable_button_set_highlight_color (
     GIMP_HIGHLIGHTABLE_BUTTON (button),
-    &(GimpRGB) HIGHLIGHT_COLOR_GREEN);
+    GIMP_HIGHLIGHTABLE_BUTTON_COLOR_AFFIRMATIVE);
   gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (layer_view),
                                   GTK_BUTTON (button),
                                   GIMP_TYPE_LAYER);


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