Issue #3533 - Tool preset doesn't restore opacity and paint mode

There is no non-hackish way of fixing this without adding a new
"use-opacity-paint-mode" property to GimpToolPreset and a new toggle
in GimpToolPresetEditor. Restoring opacity and paint mode can now be
controlled explicitly, and defaults to TRUE.

(cherry picked from commit 97b714d428)
This commit is contained in:
Michael Natterer
2020-05-12 21:10:21 +02:00
parent 2dbd3a951c
commit f274b139fc
3 changed files with 43 additions and 8 deletions

View File

@ -46,6 +46,7 @@ struct _GimpToolPresetEditorPrivate
GtkWidget *tool_label;
GtkWidget *fg_bg_toggle;
GtkWidget *opacity_paint_mode_toggle;
GtkWidget *brush_toggle;
GtkWidget *dynamics_toggle;
GtkWidget *mybrush_toggle;
@ -157,6 +158,10 @@ gimp_tool_preset_editor_constructed (GObject *object)
gtk_box_pack_start (GTK_BOX (data_editor), button, FALSE, FALSE, 0);
gtk_widget_show (button);
button = editor->priv->opacity_paint_mode_toggle =
gimp_prop_check_button_new (G_OBJECT (preset), "use-opacity-paint-mode", NULL);
gtk_box_pack_start (GTK_BOX (data_editor), button, FALSE, FALSE, 0);
button = editor->priv->brush_toggle =
gimp_prop_check_button_new (G_OBJECT (preset), "use-brush", NULL);
gtk_box_pack_start (GTK_BOX (data_editor), button, FALSE, FALSE, 0);
@ -309,6 +314,10 @@ gimp_tool_preset_editor_sync_data (GimpToolPresetEditor *editor)
(serialize_props &
(GIMP_CONTEXT_PROP_MASK_FOREGROUND |
GIMP_CONTEXT_PROP_MASK_BACKGROUND)) != 0);
gtk_widget_set_sensitive (priv->opacity_paint_mode_toggle,
(serialize_props &
(GIMP_CONTEXT_PROP_MASK_OPACITY |
GIMP_CONTEXT_PROP_MASK_PAINT_MODE)) != 0);
gtk_widget_set_sensitive (priv->brush_toggle,
(serialize_props &
GIMP_CONTEXT_PROP_MASK_BRUSH) != 0);