[gtk+] Fix preview sizing in GtkFontSelection
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Fix preview sizing in GtkFontSelection
- Date: Sun, 15 Jul 2012 15:46:20 +0000 (UTC)
commit cc310be81a998619206f457c1a8236ebd16e3b2e
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jul 15 11:45:21 2012 -0400
Fix preview sizing in GtkFontSelection
The code that was trying to limit preview size changes was
running into some width-for-height pitfalls. It turns out
that the dialog behaves quite ok without this code, so just
remove it.
gtk/deprecated/gtkfontsel.c | 20 +-------------------
1 files changed, 1 insertions(+), 19 deletions(-)
---
diff --git a/gtk/deprecated/gtkfontsel.c b/gtk/deprecated/gtkfontsel.c
index 10db4cc..0f55825 100644
--- a/gtk/deprecated/gtkfontsel.c
+++ b/gtk/deprecated/gtkfontsel.c
@@ -1184,36 +1184,18 @@ gtk_font_selection_get_font_description (GtkFontSelection *fontsel)
return font_desc;
}
-/* This sets the font in the preview entry to the selected font,
- * and tries to make sure that the preview entry is a reasonable
- * size, i.e. so that the text can be seen with a bit of space to
- * spare. But it tries to avoid resizing the entry every time the
- * font changes. This also used to shrink the preview if the font
- * size was decreased, but that made it awkward if the user wanted
- * to resize the window themself.
+/* This sets the font in the preview entry to the selected font.
*/
static void
gtk_font_selection_update_preview (GtkFontSelection *fontsel)
{
GtkFontSelectionPrivate *priv = fontsel->priv;
- gint new_height;
- GtkRequisition old_requisition, new_requisition;
GtkWidget *preview_entry = priv->preview_entry;
const gchar *text;
- gtk_widget_get_preferred_size (preview_entry, &old_requisition, NULL);
-
gtk_widget_override_font (preview_entry,
gtk_font_selection_get_font_description (fontsel));
- gtk_widget_get_preferred_size (preview_entry, &new_requisition, NULL);
-
- /* We don't ever want to be over MAX_PREVIEW_HEIGHT pixels high. */
- new_height = CLAMP (new_requisition.height, INITIAL_PREVIEW_HEIGHT, MAX_PREVIEW_HEIGHT);
-
- if (new_height > old_requisition.height || new_height < old_requisition.height - 30)
- gtk_widget_set_size_request (preview_entry, -1, new_height);
-
/* This sets the preview text, if it hasn't been set already. */
text = gtk_entry_get_text (GTK_ENTRY (preview_entry));
if (strlen (text) == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]