[gimp] app: add a "Gamma hack" toggle to the GimpImageMap dialog



commit 84ce7f1a9a5a338bfc245397289b15a58a61d1bd
Author: Michael Natterer <mitch gimp org>
Date:   Sun May 4 20:41:16 2014 +0200

    app: add a "Gamma hack" toggle to the GimpImageMap dialog

 app/tools/gimpimagemaptool.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpimagemaptool.c b/app/tools/gimpimagemaptool.c
index d3434fd..0621403 100644
--- a/app/tools/gimpimagemaptool.c
+++ b/app/tools/gimpimagemaptool.c
@@ -269,6 +269,25 @@ gimp_image_map_tool_finalize (GObject *object)
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
+static void
+gamma_hack (GtkToggleButton  *button,
+            GimpImageMapTool *image_map_tool)
+{
+  if (image_map_tool->image_map)
+    {
+      GimpTool *tool = GIMP_TOOL (image_map_tool);
+
+      gimp_tool_control_push_preserve (tool->control, TRUE);
+
+      gimp_image_map_tool_create_map (image_map_tool);
+      gimp_image_map_set_gamma_hack (image_map_tool->image_map,
+                                     gtk_toggle_button_get_active (button));
+      gimp_image_map_tool_preview (image_map_tool);
+
+      gimp_tool_control_pop_preserve (tool->control);
+    }
+}
+
 #define RESPONSE_RESET 1
 
 static gboolean
@@ -382,6 +401,15 @@ gimp_image_map_tool_initialize (GimpTool     *tool,
           gtk_widget_show (settings_ui);
         }
 
+      /*  The hack toggle  */
+      toggle = gtk_check_button_new_with_label ("Gamma hack (temp hack, please ignore)");
+      gtk_box_pack_end (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
+      gtk_widget_show (toggle);
+
+      g_signal_connect (toggle, "toggled",
+                        G_CALLBACK (gamma_hack),
+                        image_map_tool);
+
       /*  The preview toggle  */
       toggle = gimp_prop_check_button_new (G_OBJECT (tool_info->tool_options),
                                            "preview",


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