From: Michael Dominic Kostrzewa Date: Mon, 28 May 2007 14:47:41 +0000 (+0000) Subject: When the font is really big, add the scrollbar to the preview dialog. Fixes NB#54147. X-Git-Tag: 2.1.66-1~871 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=6fc2847ff60f53b584c60f19d44fdc0abb033373;p=hildon When the font is really big, add the scrollbar to the preview dialog. Fixes NB#54147. --- diff --git a/ChangeLog b/ChangeLog index d6b657b..904e047 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-28 Michael Dominic K. + + * src/hildon-font-selection-dialog.c: When the font is really big, add the + scrollbar to the preview dialog. Fixes NB#54147. + 2007-05-28 Michael Dominic Kostrzewa * src/hildon-date-editor.c: Changing the default max year to 2037. The diff --git a/src/hildon-font-selection-dialog.c b/src/hildon-font-selection-dialog.c index eb644f8..6e4ec5c 100644 --- a/src/hildon-font-selection-dialog.c +++ b/src/hildon-font-selection-dialog.c @@ -1161,10 +1161,6 @@ hildon_font_selection_dialog_show_preview (HildonFontSelectionDialog *font str = NULL; - gtk_container_add (GTK_CONTAINER (GTK_DIALOG(preview_dialog)->vbox), - preview_label); - - /* set keypress handler (ESC hardkey) */ g_signal_connect (G_OBJECT (preview_dialog), "key-press-event", G_CALLBACK(hildon_font_selection_dialog_preview_key_press), @@ -1180,13 +1176,16 @@ hildon_font_selection_dialog_show_preview (HildonFontSelectionDialog *font &family_set, "size", &size, "size-set", &size_set, NULL); - /* FIXME: This is a slightly ugly hack to force the width of the window so that - * the whole text fits with various font sizes. It's being done in such a way, - * because of some GtkLabel wrapping issues and other mysterious bugs related to - * truncating ellipsizing. Needs a rethink in future */ + /* A smallish hack to add scrollbar when font size is really big */ - gint dialog_width = (size_set && size > 24) ? 600 : 500; - gtk_window_set_default_size (GTK_WINDOW (preview_dialog), dialog_width, -1); + if (size_set && size > 24) { + GtkScrolledWindow *scrolled = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL)); + gtk_scrolled_window_set_policy (scrolled, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_add_with_viewport (scrolled, GTK_WIDGET (preview_label)); + gtk_container_add (GTK_CONTAINER (GTK_DIALOG(preview_dialog)->vbox), GTK_WIDGET (scrolled)); + gtk_widget_set_size_request (GTK_WIDGET (scrolled), -1, 400); + } else + gtk_container_add (GTK_CONTAINER (GTK_DIALOG(preview_dialog)->vbox), GTK_WIDGET (preview_label)); /* make reference text to have the same fontface and size */ if (family_set)