[gimp/blend-tool-fun: 31/163] Bug 754713 - On-canvas dialog of color picker tool always displays...



commit b4567d9d9f616e5f658d89a5998e7d430eb7e799
Author: Michael Natterer <mitch gimp org>
Date:   Wed Sep 9 01:21:57 2015 +0200

    Bug 754713 - On-canvas dialog of color picker tool always displays...
    
    ...in initially active tab
    
    We intend reuse the dialog across displays, so don't destroy the
    dialog in GIMP_TOOL_CONTROL_HALT, only hide it. This way the dialog
    keeps its detached state.

 app/tools/gimpcolorpickertool.c |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/app/tools/gimpcolorpickertool.c b/app/tools/gimpcolorpickertool.c
index e989d71..6c86943 100644
--- a/app/tools/gimpcolorpickertool.c
+++ b/app/tools/gimpcolorpickertool.c
@@ -44,6 +44,7 @@
 /*  local function prototypes  */
 
 static void   gimp_color_picker_tool_constructed   (GObject             *object);
+static void   gimp_color_picker_tool_dispose       (GObject             *object);
 
 static void   gimp_color_picker_tool_control       (GimpTool            *tool,
                                                     GimpToolAction       action,
@@ -110,6 +111,7 @@ gimp_color_picker_tool_class_init (GimpColorPickerToolClass *klass)
   GimpColorToolClass *color_tool_class = GIMP_COLOR_TOOL_CLASS (klass);
 
   object_class->constructed = gimp_color_picker_tool_constructed;
+  object_class->dispose     = gimp_color_picker_tool_dispose;
 
   tool_class->control       = gimp_color_picker_tool_control;
   tool_class->modifier_key  = gimp_color_picker_tool_modifier_key;
@@ -138,6 +140,24 @@ gimp_color_picker_tool_constructed (GObject *object)
 }
 
 static void
+gimp_color_picker_tool_dispose (GObject *object)
+{
+  GimpColorPickerTool *picker_tool = GIMP_COLOR_PICKER_TOOL (object);
+
+  if (picker_tool->gui)
+    {
+      g_object_unref (picker_tool->gui);
+
+      picker_tool->gui          = NULL;
+      picker_tool->color_area   = NULL;
+      picker_tool->color_frame1 = NULL;
+      picker_tool->color_frame2 = NULL;
+    }
+
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
 gimp_color_picker_tool_control (GimpTool       *tool,
                                 GimpToolAction  action,
                                 GimpDisplay    *display)
@@ -152,14 +172,7 @@ gimp_color_picker_tool_control (GimpTool       *tool,
 
     case GIMP_TOOL_ACTION_HALT:
       if (picker_tool->gui)
-        {
-          g_object_unref (picker_tool->gui);
-
-          picker_tool->gui          = NULL;
-          picker_tool->color_area   = NULL;
-          picker_tool->color_frame1 = NULL;
-          picker_tool->color_frame2 = NULL;
-        }
+        gimp_tool_gui_hide (picker_tool->gui);
       break;
 
     case GIMP_TOOL_ACTION_COMMIT:


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