[gimp] app: some cosmetic code cleanup in the color picker tools



commit 3a6962e0bda14daa08b19bcc09549266d96200bb
Author: Michael Natterer <mitch gimp org>
Date:   Mon Dec 1 13:49:40 2014 +0100

    app: some cosmetic code cleanup in the color picker tools

 app/tools/gimpcolorpickertool.c |    1 +
 app/tools/gimpcolortool.c       |   47 +++++++++++++++++++--------------------
 2 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/app/tools/gimpcolorpickertool.c b/app/tools/gimpcolorpickertool.c
index 10e9e73..7eb2609 100644
--- a/app/tools/gimpcolorpickertool.c
+++ b/app/tools/gimpcolorpickertool.c
@@ -218,6 +218,7 @@ gimp_color_picker_tool_oper_update (GimpTool         *tool,
   GIMP_COLOR_TOOL (tool)->pick_mode = options->pick_mode;
 
   gimp_tool_pop_status (tool, display);
+
   if (proximity)
     {
       gchar           *status_help = NULL;
diff --git a/app/tools/gimpcolortool.c b/app/tools/gimpcolortool.c
index 7dfe16d..f307ef4 100644
--- a/app/tools/gimpcolortool.c
+++ b/app/tools/gimpcolortool.c
@@ -108,10 +108,6 @@ static gboolean   gimp_color_tool_real_pick  (GimpColorTool         *color_tool,
                                               const Babl           **sample_format,
                                               GimpRGB               *color,
                                               gint                  *color_index);
-static void   gimp_color_tool_pick           (GimpColorTool         *tool,
-                                              GimpColorPickState     pick_state,
-                                              gint                   x,
-                                              gint                   y);
 static void   gimp_color_tool_real_picked    (GimpColorTool         *color_tool,
                                               GimpColorPickState     pick_state,
                                               gdouble                x,
@@ -120,6 +116,11 @@ static void   gimp_color_tool_real_picked    (GimpColorTool         *color_tool,
                                               const GimpRGB         *color,
                                               gint                   color_index);
 
+static void   gimp_color_tool_pick           (GimpColorTool         *tool,
+                                              GimpColorPickState     pick_state,
+                                              gint                   x,
+                                              gint                   y);
+
 
 G_DEFINE_TYPE (GimpColorTool, gimp_color_tool, GIMP_TYPE_DRAW_TOOL);
 
@@ -609,8 +610,8 @@ gimp_color_tool_real_picked (GimpColorTool      *color_tool,
                              const GimpRGB      *color,
                              gint                color_index)
 {
-  GimpTool          *tool = GIMP_TOOL (color_tool);
-  GimpContext       *context;
+  GimpTool    *tool = GIMP_TOOL (color_tool);
+  GimpContext *context;
 
   /*  use this tool's own options here (NOT color_tool->options)  */
   context = GIMP_CONTEXT (gimp_tool_get_options (tool));
@@ -626,29 +627,25 @@ gimp_color_tool_real_picked (GimpColorTool      *color_tool,
                                                     "gimp-indexed-palette");
           if (widget)
             {
-              GimpColormapEditor *editor;
+              GtkWidget *editor = gtk_bin_get_child (GTK_BIN (widget));
 
-              editor = GIMP_COLORMAP_EDITOR (gtk_bin_get_child (GTK_BIN (widget)));
-
-              gimp_colormap_editor_set_index (editor, color_index, NULL);
+              gimp_colormap_editor_set_index (GIMP_COLORMAP_EDITOR (editor),
+                                              color_index, NULL);
             }
         }
 
-      if (TRUE)
+      widget = gimp_dialog_factory_find_widget (gimp_dialog_factory_get_singleton (),
+                                                "gimp-palette-editor");
+      if (widget)
         {
-          widget = gimp_dialog_factory_find_widget (gimp_dialog_factory_get_singleton (),
-                                                    "gimp-palette-editor");
-          if (widget)
-            {
-              GimpPaletteEditor *editor;
-              gint               index;
-
-              editor = GIMP_PALETTE_EDITOR (gtk_bin_get_child (GTK_BIN (widget)));
-
-              index = gimp_palette_editor_get_index (editor, color);
-              if (index != -1)
-                gimp_palette_editor_set_index (editor, index, NULL);
-            }
+          GtkWidget *editor = gtk_bin_get_child (GTK_BIN (widget));
+          gint       index;
+
+          index = gimp_palette_editor_get_index (GIMP_PALETTE_EDITOR (editor),
+                                                 color);
+          if (index != -1)
+            gimp_palette_editor_set_index (GIMP_PALETTE_EDITOR (editor),
+                                           index, NULL);
         }
     }
 
@@ -733,6 +730,8 @@ gimp_color_tool_pick (GimpColorTool      *tool,
 }
 
 
+/*  public functions  */
+
 void
 gimp_color_tool_enable (GimpColorTool    *color_tool,
                         GimpColorOptions *options)


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