diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-08 08:16:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-08 08:16:47 +0000 |
commit | 74f0d9eb037dc24bdfd1f0f325e483e380451d32 (patch) | |
tree | faaaf44f426c20626c05034846c0b481c0e54983 /app/actions | |
parent | Adding upstream version 2.10.36. (diff) | |
download | gimp-74f0d9eb037dc24bdfd1f0f325e483e380451d32.tar.xz gimp-74f0d9eb037dc24bdfd1f0f325e483e380451d32.zip |
Adding upstream version 2.10.38.upstream/2.10.38upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'app/actions')
-rw-r--r-- | app/actions/data-commands.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/app/actions/data-commands.c b/app/actions/data-commands.c index 9d71bda..d93a6b1 100644 --- a/app/actions/data-commands.c +++ b/app/actions/data-commands.c @@ -117,11 +117,15 @@ data_new_cmd_callback (GimpAction *action, if (data) { + GtkWidget *edit_button; + gimp_context_set_by_type (context, gimp_data_factory_view_get_children_type (view), GIMP_OBJECT (data)); - gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view))); + edit_button = gimp_data_factory_view_get_edit_button (view); + if (edit_button && gtk_widget_get_visible (edit_button)) + gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view))); } } } @@ -149,11 +153,15 @@ data_duplicate_cmd_callback (GimpAction *action, if (new_data) { + GtkWidget *edit_button; + gimp_context_set_by_type (context, gimp_data_factory_view_get_children_type (view), GIMP_OBJECT (new_data)); - gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view))); + edit_button = gimp_data_factory_view_get_edit_button (view); + if (edit_button && gtk_widget_get_visible (edit_button)) + gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view))); } } } @@ -288,6 +296,7 @@ data_edit_cmd_callback (GimpAction *action, GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (view)); gint monitor = gimp_widget_get_monitor (GTK_WIDGET (view)); GtkWidget *dockable; + GtkWidget *editor = NULL; dockable = gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)), @@ -298,7 +307,10 @@ data_edit_cmd_callback (GimpAction *action, g_variant_get_string (value, NULL)); - gimp_data_editor_set_data (GIMP_DATA_EDITOR (gtk_bin_get_child (GTK_BIN (dockable))), - data); + if (dockable) + editor = gtk_bin_get_child (GTK_BIN (dockable)); + + if (editor && GIMP_IS_DATA_EDITOR (editor)) + gimp_data_editor_set_data (GIMP_DATA_EDITOR (editor), data); } } |