[gimp/gimp-2-8] app: enable GimpCurvesTool on construction.



commit 1b635d999fb6a9d2dda6bd2d1759b5d2997732ed
Author: Jehan <jehan girinstud io>
Date:   Thu Nov 5 18:31:06 2015 +0100

    app: enable GimpCurvesTool on construction.
    
    The Curves tool is to be considered "enabled" as soon as it is selected,
    not when it is initialized (usually at the first click on the image).
    One of the main consequence of not being "enabled" was that the tool
    cursor was wrong at selection.
    
    (cherry picked from commit 011c6db39ec182771bf7c96992e52ac388c79259)

 app/tools/gimpcurvestool.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c
index f8c9a41..fa82ba2 100644
--- a/app/tools/gimpcurvestool.c
+++ b/app/tools/gimpcurvestool.c
@@ -65,6 +65,7 @@
 
 /*  local function prototypes  */
 
+static void       gimp_curves_tool_constructed    (GObject              *object);
 static void       gimp_curves_tool_finalize       (GObject              *object);
 
 static gboolean   gimp_curves_tool_initialize     (GimpTool             *tool,
@@ -160,6 +161,7 @@ gimp_curves_tool_class_init (GimpCurvesToolClass *klass)
   GimpColorToolClass    *color_tool_class = GIMP_COLOR_TOOL_CLASS (klass);
   GimpImageMapToolClass *im_tool_class    = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
 
+  object_class->constructed          = gimp_curves_tool_constructed;
   object_class->finalize             = gimp_curves_tool_finalize;
 
   tool_class->initialize             = gimp_curves_tool_initialize;
@@ -198,6 +200,17 @@ gimp_curves_tool_init (GimpCurvesTool *tool)
 }
 
 static void
+gimp_curves_tool_constructed (GObject *object)
+{
+  G_OBJECT_CLASS (parent_class)->constructed (object);
+
+  /*  always pick colors  */
+  gimp_color_tool_enable (GIMP_COLOR_TOOL (object),
+                          GIMP_COLOR_TOOL_GET_OPTIONS (object));
+
+}
+
+static void
 gimp_curves_tool_finalize (GObject *object)
 {
   GimpCurvesTool *tool = GIMP_CURVES_TOOL (object);
@@ -234,10 +247,6 @@ gimp_curves_tool_initialize (GimpTool     *tool,
       return FALSE;
     }
 
-  /*  always pick colors  */
-  gimp_color_tool_enable (GIMP_COLOR_TOOL (tool),
-                          GIMP_COLOR_TOOL_GET_OPTIONS (tool));
-
   gimp_int_combo_box_set_sensitivity (GIMP_INT_COMBO_BOX (c_tool->channel_menu),
                                       curves_menu_sensitivity, drawable, NULL);
 


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