mirror of https://github.com/GNOME/gimp.git
added new ugly function gimp_dialog_factory_hide_dialog() which does
2007-03-13 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdialogfactory.[ch]: added new ugly function gimp_dialog_factory_hide_dialog() which does gtk_widget_hide() and sets the stored visibility state to GIMP_DIALOG_VISIBILITY_INVISIBLE in order to avoid re-showing dialogs that were already insivible due to TAB-toggling when we gtk_widget_hided them. * app/tools/gimptransformtool.c * app/tools/gimpimagemaptool.c: use the new function instead of gtk_widget_hide() to hide tool dialogs. Fixes bug #414006. svn path=/trunk/; revision=22111
This commit is contained in:
parent
14ab50ca64
commit
e8edf3f408
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2007-03-13 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpdialogfactory.[ch]: added new ugly function
|
||||
gimp_dialog_factory_hide_dialog() which does gtk_widget_hide() and
|
||||
sets the stored visibility state to GIMP_DIALOG_VISIBILITY_INVISIBLE
|
||||
in order to avoid re-showing dialogs that were already insivible due
|
||||
to TAB-toggling when we gtk_widget_hided them.
|
||||
|
||||
* app/tools/gimptransformtool.c
|
||||
* app/tools/gimpimagemaptool.c: use the new function instead of
|
||||
gtk_widget_hide() to hide tool dialogs. Fixes bug #414006.
|
||||
|
||||
2007-03-13 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* data/brushes/Makefile.am
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "core/gimpprojection.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimptooldialog.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
|
@ -469,7 +470,7 @@ gimp_image_map_tool_response (GtkWidget *widget,
|
|||
break;
|
||||
|
||||
case GTK_RESPONSE_OK:
|
||||
gtk_widget_hide (image_map_tool->shell);
|
||||
gimp_dialog_factory_hide_dialog (image_map_tool->shell);
|
||||
|
||||
if (image_map_tool->image_map)
|
||||
{
|
||||
|
@ -494,7 +495,7 @@ gimp_image_map_tool_response (GtkWidget *widget,
|
|||
break;
|
||||
|
||||
default:
|
||||
gtk_widget_hide (image_map_tool->shell);
|
||||
gimp_dialog_factory_hide_dialog (image_map_tool->shell);
|
||||
|
||||
if (image_map_tool->image_map)
|
||||
{
|
||||
|
|
|
@ -1455,7 +1455,7 @@ gimp_transform_tool_halt (GimpTransformTool *tr_tool)
|
|||
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tr_tool));
|
||||
|
||||
if (tr_tool->dialog)
|
||||
gtk_widget_hide (tr_tool->dialog);
|
||||
gimp_dialog_factory_hide_dialog (tr_tool->dialog);
|
||||
|
||||
tool->display = NULL;
|
||||
tool->drawable = NULL;
|
||||
|
|
|
@ -97,6 +97,8 @@ G_DEFINE_TYPE (GimpDialogFactory, gimp_dialog_factory, GIMP_TYPE_OBJECT)
|
|||
|
||||
#define parent_class gimp_dialog_factory_parent_class
|
||||
|
||||
static gboolean dialogs_shown = TRUE; /* FIXME */
|
||||
|
||||
|
||||
static void
|
||||
gimp_dialog_factory_class_init (GimpDialogFactoryClass *klass)
|
||||
|
@ -1013,6 +1015,26 @@ gimp_dialog_factory_show_toolbox (GimpDialogFactory *toolbox_factory)
|
|||
gtk_window_present (GTK_WINDOW (toolbox));
|
||||
}
|
||||
|
||||
void
|
||||
gimp_dialog_factory_hide_dialog (GtkWidget *dialog)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_WIDGET (dialog));
|
||||
g_return_if_fail (GTK_WIDGET_TOPLEVEL (dialog));
|
||||
|
||||
if (! gimp_dialog_factory_from_widget (dialog, NULL))
|
||||
{
|
||||
g_warning ("%s: dialog was not created by a GimpDialogFactory",
|
||||
G_STRFUNC);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_widget_hide (dialog);
|
||||
|
||||
if (! dialogs_shown)
|
||||
g_object_set_data (G_OBJECT (dialog), GIMP_DIALOG_VISIBILITY_KEY,
|
||||
GINT_TO_POINTER (GIMP_DIALOG_VISIBILITY_INVISIBLE));
|
||||
}
|
||||
|
||||
void
|
||||
gimp_dialog_factories_session_save (GimpConfigWriter *writer)
|
||||
{
|
||||
|
@ -1054,22 +1076,20 @@ gimp_dialog_factories_session_clear (void)
|
|||
void
|
||||
gimp_dialog_factories_toggle (void)
|
||||
{
|
||||
static gboolean shown = TRUE; /* FIXME */
|
||||
|
||||
GimpDialogFactoryClass *factory_class;
|
||||
|
||||
factory_class = g_type_class_peek (GIMP_TYPE_DIALOG_FACTORY);
|
||||
|
||||
if (shown)
|
||||
if (dialogs_shown)
|
||||
{
|
||||
shown = FALSE;
|
||||
dialogs_shown = FALSE;
|
||||
g_hash_table_foreach (factory_class->factories,
|
||||
(GHFunc) gimp_dialog_factories_hide_foreach,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
shown = TRUE;
|
||||
dialogs_shown = TRUE;
|
||||
g_hash_table_foreach (factory_class->factories,
|
||||
(GHFunc) gimp_dialog_factories_show_foreach,
|
||||
NULL);
|
||||
|
|
|
@ -155,6 +155,7 @@ void gimp_dialog_factory_remove_dialog (GimpDialogFactory *factory,
|
|||
|
||||
void gimp_dialog_factory_show_toolbox (GimpDialogFactory *toolbox_factory);
|
||||
|
||||
void gimp_dialog_factory_hide_dialog (GtkWidget *dialog);
|
||||
|
||||
void gimp_dialog_factories_session_save (GimpConfigWriter *writer);
|
||||
void gimp_dialog_factories_session_restore (void);
|
||||
|
|
Loading…
Reference in New Issue