always start with an empty text.

2003-02-20  Sven Neumann  <sven@gimp.org>

	* app/tools/gimptexttool.c: always start with an empty text.
This commit is contained in:
Sven Neumann
2003-02-20 17:05:10 +00:00
committed by Sven Neumann
parent df09eb68d3
commit e105077033
2 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2003-02-20 Sven Neumann <sven@gimp.org>
* app/tools/gimptexttool.c: always start with an empty text.
2003-02-20 Sven Neumann <sven@gimp.org> 2003-02-20 Sven Neumann <sven@gimp.org>
* libgimpbase/gimputils.c (gimp_utf8_strtrim): trim the string * libgimpbase/gimputils.c (gimp_utf8_strtrim): trim the string

View File

@ -233,7 +233,6 @@ text_tool_button_press (GimpTool *tool,
gimp_text_tool_connect (GIMP_TEXT_TOOL (tool), text); gimp_text_tool_connect (GIMP_TEXT_TOOL (tool), text);
if (!text || text == text_tool->text)
text_tool_editor (text_tool); text_tool_editor (text_tool);
} }
@ -312,6 +311,10 @@ gimp_text_tool_connect (GimpTextTool *tool,
g_object_unref (tool->text); g_object_unref (tool->text);
tool->text = NULL; tool->text = NULL;
g_object_set (G_OBJECT (options->text),
"text", NULL,
NULL);
} }
if (text) if (text)
@ -330,7 +333,6 @@ static void
text_tool_editor (GimpTextTool *text_tool) text_tool_editor (GimpTextTool *text_tool)
{ {
GimpTextOptions *options; GimpTextOptions *options;
GClosure *closure;
if (text_tool->editor) if (text_tool->editor)
{ {
@ -346,12 +348,17 @@ text_tool_editor (GimpTextTool *text_tool)
g_object_add_weak_pointer (G_OBJECT (text_tool->editor), g_object_add_weak_pointer (G_OBJECT (text_tool->editor),
(gpointer *) &text_tool->editor); (gpointer *) &text_tool->editor);
gtk_widget_show (text_tool->editor);
if (! text_tool->text)
{
GClosure *closure;
closure = g_cclosure_new (G_CALLBACK (text_tool_buffer_changed), closure = g_cclosure_new (G_CALLBACK (text_tool_buffer_changed),
text_tool, NULL); text_tool, NULL);
g_object_watch_closure (G_OBJECT (text_tool->editor), closure); g_object_watch_closure (G_OBJECT (text_tool->editor), closure);
g_signal_connect_closure (options->buffer, "changed", closure, FALSE); g_signal_connect_closure (options->buffer, "changed", closure, FALSE);
}
gtk_widget_show (text_tool->editor);
} }
static void static void