Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-sidebar-thumbnails.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2006-08-15 15:40:01 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2006-08-15 15:40:01 (GMT)
commite152957bf15c885d820665a30cbfbed955bd8279 (patch)
tree7ce02eefa0a2ba94cde17d14884f9778aeaf8726 /shell/ev-sidebar-thumbnails.c
parent55469574c4d69969863212539fca0537361a8c77 (diff)
Do not render thumbnails unless thumbnails page is active in the sidebar.
2006-08-14 Carlos Garcia Campos <carlosgc@gnome.org> * shell/ev-sidebar-thumbnails.c: Do not render thumbnails unless thumbnails page is active in the sidebar.
Diffstat (limited to 'shell/ev-sidebar-thumbnails.c')
-rw-r--r--shell/ev-sidebar-thumbnails.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c
index ec83149..01c996b 100644
--- a/shell/ev-sidebar-thumbnails.c
+++ b/shell/ev-sidebar-thumbnails.c
@@ -85,6 +85,7 @@ static void ev_sidebar_thumbnails_set_document (EvSidebarPage
static const gchar* ev_sidebar_thumbnails_get_label (EvSidebarPage *sidebar_page);
static void thumbnail_job_completed_callback (EvJobThumbnail *job,
EvSidebarThumbnails *sidebar_thumbnails);
+static void adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails);
G_DEFINE_TYPE_EXTENDED (EvSidebarThumbnails,
ev_sidebar_thumbnails,
@@ -124,8 +125,7 @@ ev_sidebar_thumbnails_get_property (GObject *object,
{
EvSidebarThumbnails *sidebar = EV_SIDEBAR_THUMBNAILS (object);
- switch (prop_id)
- {
+ switch (prop_id) {
case PROP_WIDGET:
if (sidebar->priv->tree_view)
g_value_set_object (value, sidebar->priv->tree_view);
@@ -139,16 +139,31 @@ ev_sidebar_thumbnails_get_property (GObject *object,
}
static void
+ev_sidebar_thumbnails_map (GtkWidget *widget)
+{
+ EvSidebarThumbnails *sidebar;
+
+ sidebar = EV_SIDEBAR_THUMBNAILS (widget);
+
+ GTK_WIDGET_CLASS (ev_sidebar_thumbnails_parent_class)->map (widget);
+
+ adjustment_changed_cb (sidebar);
+}
+
+static void
ev_sidebar_thumbnails_class_init (EvSidebarThumbnailsClass *ev_sidebar_thumbnails_class)
{
GObjectClass *g_object_class;
GtkObjectClass *gtk_object_class;
+ GtkWidgetClass *widget_class;
g_object_class = G_OBJECT_CLASS (ev_sidebar_thumbnails_class);
gtk_object_class = GTK_OBJECT_CLASS (ev_sidebar_thumbnails_class);
+ widget_class = GTK_WIDGET_CLASS (ev_sidebar_thumbnails_class);
g_object_class->dispose = ev_sidebar_thumbnails_dispose;
g_object_class->get_property = ev_sidebar_thumbnails_get_property;
+ widget_class->map = ev_sidebar_thumbnails_map;
g_object_class_override_property (g_object_class,
PROP_WIDGET,
@@ -290,6 +305,10 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails)
gint wy1;
gint wy2;
+ /* Widget is not currently visible */
+ if (!GTK_WIDGET_MAPPED (sidebar_thumbnails))
+ return;
+
if (priv->tree_view) {
if (! GTK_WIDGET_REALIZED (priv->tree_view))
return;