aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-09-04 03:51:24 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-09-04 03:54:46 +0800
commitaea0c271af64fef12c887c04cc2f760aca8391f8 (patch)
tree264d2117207a5800e389712c0748948fb391b877
parent04b01c5b1c969978a825087be1e0d3c91598a890 (diff)
downloadgsoc2013-epiphany-aea0c271af64fef12c887c04cc2f760aca8391f8.tar.gz
gsoc2013-epiphany-aea0c271af64fef12c887c04cc2f760aca8391f8.tar.zst
gsoc2013-epiphany-aea0c271af64fef12c887c04cc2f760aca8391f8.zip
ephy-overview-store: hide the close button while animating a removed item
To do this, add the render policy as a column to the model and use it as a cellrenderer attribute. The default value is already PRELIT. When removing the cell, flip it to NEVER.
-rw-r--r--lib/widgets/ephy-overview-store.c13
-rw-r--r--lib/widgets/ephy-overview-store.h1
-rw-r--r--lib/widgets/gd-main-icon-view.c3
3 files changed, 17 insertions, 0 deletions
diff --git a/lib/widgets/ephy-overview-store.c b/lib/widgets/ephy-overview-store.c
index 5ec9f9925..312a24ffc 100644
--- a/lib/widgets/ephy-overview-store.c
+++ b/lib/widgets/ephy-overview-store.c
@@ -21,7 +21,9 @@
#include "config.h"
#include "ephy-history-service.h"
#include "ephy-overview-store.h"
+#include "ephy-removable-pixbuf-renderer.h"
#include "ephy-snapshot-service.h"
+#include "ephy-widgets-type-builtins.h"
/* Update thumbnails after one week. */
#define THUMBNAIL_UPDATE_THRESHOLD (60 * 60 * 24 * 7)
@@ -163,6 +165,7 @@ ephy_overview_store_init (EphyOverviewStore *self)
types[EPHY_OVERVIEW_STORE_SELECTED] = G_TYPE_BOOLEAN;
types[EPHY_OVERVIEW_STORE_SNAPSHOT_CANCELLABLE] = G_TYPE_CANCELLABLE;
types[EPHY_OVERVIEW_STORE_SNAPSHOT_MTIME] = G_TYPE_LONG;
+ types[EPHY_OVERVIEW_STORE_CLOSE_BUTTON_RENDER_POLICY] = EPHY_TYPE_REMOVABLE_PIXBUF_RENDER_POLICY;
gtk_list_store_set_column_types (GTK_LIST_STORE (self),
EPHY_OVERVIEW_STORE_NCOLS, types);
@@ -572,12 +575,22 @@ ephy_overview_store_animated_remove (EphyOverviewStore *store,
EphyOverviewStoreAnimRemoveFunc callback,
gpointer user_data)
{
+ GtkTreePath *path;
+ GtkTreeIter iter;
AnimRemoveContext *ctx = g_slice_new0 (AnimRemoveContext);
ctx->ref = ref;
ctx->callback = callback;
ctx->user_data = user_data;
+ path = gtk_tree_row_reference_get_path (ref);
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path);
+ gtk_tree_path_free (path);
+
+ gtk_list_store_set (GTK_LIST_STORE (store), &iter,
+ EPHY_OVERVIEW_STORE_CLOSE_BUTTON_RENDER_POLICY,
+ EPHY_REMOVABLE_PIXBUF_RENDER_NEVER, -1);
+
g_timeout_add (40, (GSourceFunc) animated_remove_func, ctx);
}
diff --git a/lib/widgets/ephy-overview-store.h b/lib/widgets/ephy-overview-store.h
index f6201bf99..5732cabc1 100644
--- a/lib/widgets/ephy-overview-store.h
+++ b/lib/widgets/ephy-overview-store.h
@@ -64,6 +64,7 @@ enum {
EPHY_OVERVIEW_STORE_SELECTED = GD_MAIN_COLUMN_SELECTED,
EPHY_OVERVIEW_STORE_SNAPSHOT_CANCELLABLE,
EPHY_OVERVIEW_STORE_SNAPSHOT_MTIME,
+ EPHY_OVERVIEW_STORE_CLOSE_BUTTON_RENDER_POLICY,
EPHY_OVERVIEW_STORE_NCOLS
};
diff --git a/lib/widgets/gd-main-icon-view.c b/lib/widgets/gd-main-icon-view.c
index 1f258f243..06584f7bc 100644
--- a/lib/widgets/gd-main-icon-view.c
+++ b/lib/widgets/gd-main-icon-view.c
@@ -19,6 +19,7 @@
*
*/
+#include "ephy-overview-store.h"
#include "ephy-removable-pixbuf-renderer.h"
#include "gd-main-icon-view.h"
#include "gd-main-view.h"
@@ -119,6 +120,8 @@ gd_main_icon_view_constructed (GObject *obj)
"active", GD_MAIN_COLUMN_SELECTED);
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (self), cell,
"pixbuf", GD_MAIN_COLUMN_ICON);
+ gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (self), cell,
+ "render-policy", EPHY_OVERVIEW_STORE_CLOSE_BUTTON_RENDER_POLICY);
cell = gd_two_lines_renderer_new ();
g_object_set (cell,