aboutsummaryrefslogtreecommitdiffstats
path: root/lib/widgets/ephy-frecent-store.c
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-08-30 21:22:42 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-09-01 02:34:03 +0800
commit67736b8c9a8917c522e7432bda74379f768ec501 (patch)
tree75d6bea1d634747a147c42176d6484af4c1f5184 /lib/widgets/ephy-frecent-store.c
parent02542c5fd0fde31161b6fe64128e8bf0a029b028 (diff)
downloadgsoc2013-epiphany-67736b8c9a8917c522e7432bda74379f768ec501.tar
gsoc2013-epiphany-67736b8c9a8917c522e7432bda74379f768ec501.tar.gz
gsoc2013-epiphany-67736b8c9a8917c522e7432bda74379f768ec501.tar.bz2
gsoc2013-epiphany-67736b8c9a8917c522e7432bda74379f768ec501.tar.lz
gsoc2013-epiphany-67736b8c9a8917c522e7432bda74379f768ec501.tar.xz
gsoc2013-epiphany-67736b8c9a8917c522e7432bda74379f768ec501.tar.zst
gsoc2013-epiphany-67736b8c9a8917c522e7432bda74379f768ec501.zip
ephy-frecent-store: animate hiding of store items
Add a ephy_overview_store_animated_remove() that shrinks the thumbnail in a timeout until it's small enough and then removes it from the model.
Diffstat (limited to 'lib/widgets/ephy-frecent-store.c')
-rw-r--r--lib/widgets/ephy-frecent-store.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/lib/widgets/ephy-frecent-store.c b/lib/widgets/ephy-frecent-store.c
index 540c1007c..2a60c7c63 100644
--- a/lib/widgets/ephy-frecent-store.c
+++ b/lib/widgets/ephy-frecent-store.c
@@ -341,15 +341,34 @@ ephy_frecent_store_new (void)
}
static void
+animated_remove_cb (EphyOverviewStore *store,
+ GtkTreeIter *iter,
+ gboolean valid,
+ EphyHistoryService *service)
+{
+ ephy_frecent_store_fetch_urls (EPHY_FRECENT_STORE (store), service);
+}
+
+static void
set_url_hidden_cb (EphyHistoryService *service,
gboolean success,
gpointer result_data,
- EphyFrecentStore *store)
+ GtkTreeRowReference *ref)
{
+ EphyOverviewStore *store;
+ GtkTreePath *path;
+ GtkTreeIter iter;
+
if (!success)
return;
- ephy_frecent_store_fetch_urls (store, service);
+ store = EPHY_OVERVIEW_STORE (gtk_tree_row_reference_get_model (ref));
+ path = gtk_tree_row_reference_get_path (ref);
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path);
+ gtk_tree_path_free (path);
+ ephy_overview_store_animated_remove (store, ref,
+ (EphyOverviewStoreAnimRemoveFunc)animated_remove_cb,
+ service);
}
void
@@ -357,20 +376,27 @@ ephy_frecent_store_set_hidden (EphyFrecentStore *store,
GtkTreeIter *iter)
{
EphyHistoryService *service;
+ GtkTreeRowReference *ref;
+ GtkTreePath *path;
char *uri;
-
+ GtkTreeModel *model;
g_return_if_fail (EPHY_IS_FRECENT_STORE (store));
g_return_if_fail (iter != NULL);
- gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
+ model = GTK_TREE_MODEL (store);
+ gtk_tree_model_get (model, iter,
EPHY_OVERVIEW_STORE_URI, &uri,
-1);
g_object_get (store, "history-service", &service, NULL);
+ path = gtk_tree_model_get_path (model, iter);
+ ref = gtk_tree_row_reference_new (model, path);
+ gtk_tree_path_free (path);
+
ephy_history_service_set_url_hidden (service,
uri, TRUE, NULL,
(EphyHistoryJobCallback) set_url_hidden_cb,
- store);
+ ref);
g_free (uri);
g_object_unref (service);
}