diff --git a/app/core/gimptoolpreset.c b/app/core/gimptoolpreset.c index 69f4967ae1..2e5e5c8161 100644 --- a/app/core/gimptoolpreset.c +++ b/app/core/gimptoolpreset.c @@ -33,7 +33,7 @@ #include "gimp-intl.h" -#define DEFAULT_USE_FG_BG TRUE +#define DEFAULT_USE_FG_BG FALSE #define DEFAULT_USE_BRUSH TRUE #define DEFAULT_USE_DYNAMICS TRUE #define DEFAULT_USE_GRADIENT TRUE @@ -180,8 +180,6 @@ gimp_tool_preset_constructor (GType type, preset = GIMP_TOOL_PRESET (object); - g_assert (GIMP_IS_GIMP (preset->gimp)); - return object; } diff --git a/app/tools/tool_manager.c b/app/tools/tool_manager.c index 35160ae217..5bbc23f2c4 100644 --- a/app/tools/tool_manager.c +++ b/app/tools/tool_manager.c @@ -638,6 +638,10 @@ tool_manager_preset_changed (GimpContext *user_context, gimp_context_set_tool (user_context, preset_tool); else tool_manager_connect_options (user_context, preset_tool); + + gimp_context_copy_properties (GIMP_CONTEXT (preset->tool_options), + user_context, + gimp_tool_preset_get_prop_mask (preset)); } static void diff --git a/app/widgets/gimptoolpreseteditor.c b/app/widgets/gimptoolpreseteditor.c index cdb6916a00..cbfcdb5ed7 100644 --- a/app/widgets/gimptoolpreseteditor.c +++ b/app/widgets/gimptoolpreseteditor.c @@ -78,6 +78,53 @@ gimp_tool_preset_editor_class_init (GimpToolPresetEditorClass *klass) static void gimp_tool_preset_editor_init (GimpToolPresetEditor *editor) { + GimpDataEditor *data_editor = GIMP_DATA_EDITOR (editor); + GimpToolPreset *preset; + GtkWidget *button; + + preset = editor->tool_preset_model = g_object_new (GIMP_TYPE_TOOL_PRESET, + //"gimp", data_editor->context->gimp, + NULL); + + g_signal_connect (preset, "notify", + G_CALLBACK (gimp_tool_preset_editor_notify_model), + editor); + + button = gimp_prop_check_button_new (G_OBJECT (preset), "use-fg-bg", _("Apply stored FG/BG")); + gtk_box_pack_start (GTK_BOX (data_editor), button, + FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gimp_prop_check_button_new (G_OBJECT (preset), "use-brush", _("Apply stored brush")); + gtk_box_pack_start (GTK_BOX (data_editor), button, + FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gimp_prop_check_button_new (G_OBJECT (preset), "use-dynamics", _("Apply stored dynamics")); + gtk_box_pack_start (GTK_BOX (data_editor), button, + FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gimp_prop_check_button_new (G_OBJECT (preset), "use-gradient", _("Apply stored gradient")); + gtk_box_pack_start (GTK_BOX (data_editor), button, + FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gimp_prop_check_button_new (G_OBJECT (preset), "use-pattern", _("Apply stored pattern")); + gtk_box_pack_start (GTK_BOX (data_editor), button, + FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gimp_prop_check_button_new (G_OBJECT (preset), "use-palette", _("Apply stored pallete")); + gtk_box_pack_start (GTK_BOX (data_editor), button, + FALSE, FALSE, 0); + gtk_widget_show (button); + + button = gimp_prop_check_button_new (G_OBJECT (preset), "use-font", _("Apply stored font")); + gtk_box_pack_start (GTK_BOX (data_editor), button, + FALSE, FALSE, 0); + gtk_widget_show (button); + } static GObject * @@ -94,10 +141,6 @@ gimp_tool_preset_editor_constructor (GType type, editor = GIMP_TOOL_PRESET_EDITOR (object); data_editor = GIMP_DATA_EDITOR (editor); - editor->tool_preset_model = g_object_new (GIMP_TYPE_TOOL_PRESET, - "gimp", data_editor->context->gimp, - NULL); - gimp_docked_set_show_button_bar (GIMP_DOCKED (object), FALSE); return object;