forked from AuroraMiddleware/gtk
fontchooser: Make changing the preview text fast
Instead of reloading the font list, we now just queue a redraw. This works, because the preview text is added using a cell data func instead of a custom column.
This commit is contained in:
parent
5834691e69
commit
6cbbc789d5
@ -1036,16 +1036,18 @@ static void
|
||||
gtk_font_chooser_widget_set_preview_text (GtkFontChooserWidget *fontchooser,
|
||||
const gchar *text)
|
||||
{
|
||||
g_free (fontchooser->priv->preview_text);
|
||||
fontchooser->priv->preview_text = g_strdup (text);
|
||||
GtkFontChooserWidgetPrivate *priv = fontchooser->priv;
|
||||
|
||||
populate_list (fontchooser,
|
||||
GTK_TREE_VIEW (fontchooser->priv->family_face_list),
|
||||
fontchooser->priv->model);
|
||||
g_free (priv->preview_text);
|
||||
priv->preview_text = g_strdup (text);
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (fontchooser->priv->preview), text);
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->preview), text);
|
||||
|
||||
g_object_notify (G_OBJECT (fontchooser), "preview-text");
|
||||
|
||||
/* XXX: There's no API to tell the treeview that a column has changed,
|
||||
* so we just */
|
||||
gtk_widget_queue_draw (priv->family_face_list);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user