[gtk+/composite-templates] fontchooserwidget: scroll to the currently selected row
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/composite-templates] fontchooserwidget: scroll to the currently selected row
- Date: Sat, 6 Oct 2012 16:55:27 +0000 (UTC)
commit 74fdf96c417ead77dbb7c53161db92a8f2b26278
Author: Colomban Wendling <ban herbesfolles org>
Date: Sun Sep 16 19:17:08 2012 +0200
fontchooserwidget: scroll to the currently selected row
Scroll to the selection when setting it so the selected font is
visible on screen. This is especially useful if an initial font is
set for the user to see it.
https://bugzilla.gnome.org/show_bug.cgi?id=684156
gtk/gtkfontchooserwidget.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index d3503fb..7454a35 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -1062,7 +1062,13 @@ gtk_font_chooser_widget_ensure_selection (GtkFontChooserWidget *fontchooser)
&filter_iter,
&priv->font_iter))
{
+ GtkTreePath *path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->filter_model),
+ &filter_iter);
+
gtk_tree_selection_select_iter (selection, &filter_iter);
+ gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (priv->family_face_list),
+ path, NULL, FALSE, 0.0, 0.0);
+ gtk_tree_path_free (path);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]