[libgd] view: Make selection changes instant
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd] view: Make selection changes instant
- Date: Tue, 14 Jan 2014 15:36:44 +0000 (UTC)
commit 9f2e27fe2d2d5f5def655ca74961b9c721e6e0b7
Author: Bastien Nocera <hadess hadess net>
Date: Tue Jan 14 15:31:33 2014 +0100
view: Make selection changes instant
If the view model was a filter model, the selection icon would only
appear or disappear on mouse hover, when the tree view was fetching the
value of the selected column again. This makes it look like selection
is horribly slow.
This patch makes sure that the icon view is instantly updated.
libgd/gd-main-view.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/libgd/gd-main-view.c b/libgd/gd-main-view.c
index 73bd70a..9a9781f 100644
--- a/libgd/gd-main-view.c
+++ b/libgd/gd-main-view.c
@@ -343,6 +343,7 @@ do_select_row (GdMainView *self,
GtkTreeModel *model;
GtkTreeModelFilter *filter;
GtkTreeIter my_iter, child_iter;
+ GtkTreePath *path;
model = self->priv->model;
my_iter = *iter;
@@ -367,6 +368,14 @@ do_select_row (GdMainView *self,
GD_MAIN_COLUMN_SELECTED, value,
-1);
}
+
+ /* And tell the view model that something changed */
+ path = gtk_tree_model_get_path (self->priv->model, iter);
+ if (path)
+ {
+ gtk_tree_model_row_changed (self->priv->model, path, iter);
+ gtk_tree_path_free (path);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]