[gimp/soc-2011-seamless-clone2] app: more cleanup in GimpImageMapTool's overlay dialog handling



commit af6ca05c8eb51b80629a978cc74f3d935ea520e3
Author: Michael Natterer <mitch gimp org>
Date:   Thu Apr 25 22:46:05 2013 +0200

    app: more cleanup in GimpImageMapTool's overlay dialog handling
    
    gimp_image_map_tool_initialize(): clean up adding the overlay.
    
    gimp_image_map_tool_dialog_hide(): hide the overlay before removing it.

 app/tools/gimpimagemaptool.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/app/tools/gimpimagemaptool.c b/app/tools/gimpimagemaptool.c
index be0af1b..ee8ce92 100644
--- a/app/tools/gimpimagemaptool.c
+++ b/app/tools/gimpimagemaptool.c
@@ -407,15 +407,8 @@ gimp_image_map_tool_initialize (GimpTool     *tool,
 
       gtk_widget_show (vbox);
     }
-  else if (GIMP_IS_OVERLAY_DIALOG (image_map_tool->dialog) &&
-           ! gtk_widget_get_parent (image_map_tool->dialog))
-    {
-      gimp_overlay_box_add_child (GIMP_OVERLAY_BOX (display_shell->canvas),
-                                  image_map_tool->dialog, 1.0, 1.0);
-      g_object_unref (image_map_tool->dialog);
-    }
 
-  if (! image_map_tool->overlay)
+  if (GIMP_IS_VIEWABLE_DIALOG (image_map_tool->dialog))
     {
       gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (image_map_tool->dialog),
                                          GIMP_VIEWABLE (drawable),
@@ -423,6 +416,15 @@ gimp_image_map_tool_initialize (GimpTool     *tool,
       gimp_tool_dialog_set_shell (GIMP_TOOL_DIALOG (image_map_tool->dialog),
                                   display_shell);
     }
+  else if (GIMP_IS_OVERLAY_DIALOG (image_map_tool->dialog))
+    {
+      if (! gtk_widget_get_parent (image_map_tool->dialog))
+        {
+          gimp_overlay_box_add_child (GIMP_OVERLAY_BOX (display_shell->canvas),
+                                      image_map_tool->dialog, 1.0, 1.0);
+          g_object_unref (image_map_tool->dialog);
+        }
+    }
 
   gtk_widget_show (image_map_tool->dialog);
 
@@ -736,6 +738,7 @@ gimp_image_map_tool_dialog_hide (GimpImageMapTool *image_map_tool)
       if (gtk_widget_get_parent (dialog))
         {
           g_object_ref (dialog);
+          gtk_widget_hide (dialog);
           gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (dialog)),
                                 dialog);
         }


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