don't hardcode font sizes, moved newlines out of translatable strings.

2006-10-27  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/script-fu-console.c: don't hardcode font sizes,
	moved newlines out of translatable strings.
This commit is contained in:
Sven Neumann 2006-10-27 13:18:38 +00:00 committed by Sven Neumann
parent 2528519869
commit 6fb3b16091
2 changed files with 29 additions and 29 deletions

View File

@ -1,3 +1,8 @@
2006-10-27 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/script-fu-console.c: don't hardcode font sizes,
moved newlines out of translatable strings.
2006-10-27 Michael Natterer <mitch@gimp.org> 2006-10-27 Michael Natterer <mitch@gimp.org>
* app/plug-in/gimpplugin-message.c (gimp_plug_in_handle_proc_run): * app/plug-in/gimpplugin-message.c (gimp_plug_in_handle_proc_run):

View File

@ -186,32 +186,31 @@ script_fu_console_interface (void)
output = console->text_view; output = console->text_view;
gtk_text_view_set_editable (GTK_TEXT_VIEW (console->text_view), FALSE); gtk_text_view_set_editable (GTK_TEXT_VIEW (console->text_view), FALSE);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (console->text_view), 12); gtk_text_view_set_left_margin (GTK_TEXT_VIEW (console->text_view), 6);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (console->text_view), 12); gtk_text_view_set_right_margin (GTK_TEXT_VIEW (console->text_view), 6);
gtk_widget_set_size_request (console->text_view, TEXT_WIDTH, TEXT_HEIGHT); gtk_widget_set_size_request (console->text_view, TEXT_WIDTH, TEXT_HEIGHT);
gtk_container_add (GTK_CONTAINER (scrolled_window), console->text_view); gtk_container_add (GTK_CONTAINER (scrolled_window), console->text_view);
gtk_widget_show (console->text_view); gtk_widget_show (console->text_view);
gtk_text_buffer_create_tag (console->console, "strong", gtk_text_buffer_create_tag (console->console, "strong",
"weight", PANGO_WEIGHT_BOLD, "weight", PANGO_WEIGHT_BOLD,
"size", 12 * PANGO_SCALE, "scale", PANGO_SCALE_LARGE,
NULL); NULL);
gtk_text_buffer_create_tag (console->console, "emphasis", gtk_text_buffer_create_tag (console->console, "emphasis",
"style", PANGO_STYLE_OBLIQUE, "style", PANGO_STYLE_OBLIQUE,
"size", 10 * PANGO_SCALE,
NULL);
gtk_text_buffer_create_tag (console->console, "weak",
"size", 10 * PANGO_SCALE,
NULL); NULL);
{ {
const gchar *greeting_texts[] = const gchar * const greetings[] =
{ {
"strong", _("Welcome to TinyScheme\n"), "strong", _("Welcome to TinyScheme"),
"weak", _("Copyright (c) Dimitrios Souflis\n\n"), NULL, "\n",
"strong", _("Script-Fu Console - "), NULL, "Copyright (c) Dimitrios Souflis",
NULL, "\n",
"strong", _("Script-Fu Console"),
NULL, " - ",
"emphasis", _("Interactive Scheme Development"), "emphasis", _("Interactive Scheme Development"),
NULL NULL, "\n"
}; };
GtkTextIter cursor; GtkTextIter cursor;
@ -219,12 +218,16 @@ script_fu_console_interface (void)
gtk_text_buffer_get_end_iter (console->console, &cursor); gtk_text_buffer_get_end_iter (console->console, &cursor);
for (i = 0; greeting_texts[i]; i += 2) for (i = 0; i < G_N_ELEMENTS (greetings); i += 2)
{ {
if (greetings[i])
gtk_text_buffer_insert_with_tags_by_name (console->console, &cursor, gtk_text_buffer_insert_with_tags_by_name (console->console, &cursor,
greeting_texts[i + 1], -1, greetings[i + 1], -1,
greeting_texts[i], greetings[i],
NULL); NULL);
else
gtk_text_buffer_insert (console->console, &cursor,
greetings[i + 1], -1);
} }
} }
@ -515,10 +518,7 @@ script_fu_output_to_console (const gchar *text,
GtkTextIter cursor; GtkTextIter cursor;
gtk_text_buffer_get_end_iter (buffer, &cursor); gtk_text_buffer_get_end_iter (buffer, &cursor);
gtk_text_buffer_insert_with_tags_by_name (buffer, &cursor, gtk_text_buffer_insert (buffer, &cursor, text, len);
text, len,
"weak",
NULL);
script_fu_console_scroll_end (output); script_fu_console_scroll_end (output);
} }
@ -571,15 +571,10 @@ script_fu_cc_key_function (GtkWidget *widget,
"strong", "strong",
NULL); NULL);
gtk_text_buffer_insert_with_tags_by_name (console->console, &cursor, gtk_text_buffer_insert (console->console, &cursor,
gtk_entry_get_text (GTK_ENTRY (console->cc)), -1, gtk_entry_get_text (GTK_ENTRY (console->cc)), -1);
"weak",
NULL);
gtk_text_buffer_insert_with_tags_by_name (console->console, &cursor, gtk_text_buffer_insert (console->console, &cursor, "\n", -1);
"\n", -1,
"weak",
NULL);
script_fu_console_scroll_end (console->text_view); script_fu_console_scroll_end (console->text_view);