diff --git a/app/tools/gimptextoptions.c b/app/tools/gimptextoptions.c index eb69392852bef31326e644007fb3297dd0dae3c1..c6e09414791aa817eca60d4e09ae508cf153f072 100644 --- a/app/tools/gimptextoptions.c +++ b/app/tools/gimptextoptions.c @@ -84,6 +84,7 @@ enum PROP_OUTLINE_DASH_OFFSET, PROP_OUTLINE_DASH_INFO, PROP_USE_EDITOR, + PROP_SHOW_ON_CANVAS_EDITOR, PROP_FONT_VIEW_TYPE, PROP_FONT_VIEW_SIZE @@ -245,11 +246,18 @@ gimp_text_options_class_init (GimpTextOptionsClass *klass) GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_USE_EDITOR, "use-editor", - _("Use editor"), + _("Use editor window"), _("Use an external editor window for text entry"), FALSE, GIMP_PARAM_STATIC_STRINGS); + GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_SHOW_ON_CANVAS_EDITOR, + "show-on-canvas", + _("Show on-canvas editor"), + _("Show on-canvas text editor"), + TRUE, + GIMP_PARAM_STATIC_STRINGS); + GIMP_CONFIG_PROP_ENUM (object_class, PROP_FONT_VIEW_TYPE, "font-view-type", NULL, NULL, @@ -457,6 +465,9 @@ gimp_text_options_get_property (GObject *object, case PROP_USE_EDITOR: g_value_set_boolean (value, options->use_editor); break; + case PROP_SHOW_ON_CANVAS_EDITOR: + g_value_set_boolean (value, options->show_on_canvas); + break; case PROP_FONT_VIEW_TYPE: g_value_set_enum (value, options->font_view_type); @@ -571,6 +582,9 @@ gimp_text_options_set_property (GObject *object, case PROP_USE_EDITOR: options->use_editor = g_value_get_boolean (value); break; + case PROP_SHOW_ON_CANVAS_EDITOR: + options->show_on_canvas = g_value_get_boolean (value); + break; case PROP_FONT_VIEW_TYPE: options->font_view_type = g_value_get_enum (value); @@ -626,6 +640,7 @@ gimp_text_options_reset (GimpConfig *config) gimp_config_reset_property (object, "outline-dash-info"); gimp_config_reset_property (object, "use-editor"); + gimp_config_reset_property (object, "use-on-canvas"); } static void @@ -803,6 +818,9 @@ gimp_text_options_gui (GimpToolOptions *tool_options) button = gimp_prop_check_button_new (config, "use-editor", NULL); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + button = gimp_prop_check_button_new (config, "show-on-canvas", NULL); + gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); + button = gimp_prop_check_button_new (config, "antialias", NULL); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); diff --git a/app/tools/gimptextoptions.h b/app/tools/gimptextoptions.h index b45d8625d81b2e9382a5004be8de693903051a99..0a85bb8f7e264dcf78fdfbcea7e251bf58bdcbd0 100644 --- a/app/tools/gimptextoptions.h +++ b/app/tools/gimptextoptions.h @@ -66,6 +66,7 @@ struct _GimpTextOptions GimpViewSize font_view_size; gboolean use_editor; + gboolean show_on_canvas; /* options gui */ GtkWidget *size_entry; diff --git a/app/tools/gimptexttool-editor.c b/app/tools/gimptexttool-editor.c index ee73694ae8bae42b20fe469ac0d483800c5c5272..9a8d97808c6f29a2cb2eb1fd7d956c5e1ff394ce 100644 --- a/app/tools/gimptexttool-editor.c +++ b/app/tools/gimptexttool-editor.c @@ -193,6 +193,9 @@ gimp_text_tool_editor_start (GimpTextTool *text_tool) g_signal_connect (options, "notify::use-editor", G_CALLBACK (gimp_text_tool_options_notify), text_tool); + g_signal_connect (options, "notify::show-on-canvas", + G_CALLBACK (gimp_text_tool_options_notify), + text_tool); if (! text_tool->style_overlay) { @@ -223,7 +226,9 @@ gimp_text_tool_editor_start (GimpTextTool *text_tool) xres, yres); gtk_container_add (GTK_CONTAINER (text_tool->style_overlay), text_tool->style_editor); - gtk_widget_show (text_tool->style_editor); + + if (options->show_on_canvas) + gtk_widget_show (text_tool->style_editor); } gimp_text_tool_editor_position (text_tool); @@ -1328,6 +1333,11 @@ gimp_text_tool_options_notify (GimpTextOptions *options, gtk_widget_destroy (text_tool->editor_dialog); } } + else if (! strcmp (param_name, "show-on-canvas")) + { + gtk_widget_set_visible (text_tool->style_editor, + options->show_on_canvas); + } } static void