[gnome-photos] Don't show a glimpse of the older item when going back to the preview
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] Don't show a glimpse of the older item when going back to the preview
- Date: Fri, 26 Sep 2014 16:06:34 +0000 (UTC)
commit 8daa978fe226f1088413eaac449c09a1c2c49fe1
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Sep 26 17:35:38 2014 +0200
Don't show a glimpse of the older item when going back to the preview
Now that our spinner is overlaid and we switch to the preview as soon
as it starts loading, we should take care to clear any older item that
might have been previewed earlier.
Fixes: https://bugzilla.gnome.org/734845
src/photos-embed.c | 1 +
src/photos-preview-view.c | 23 ++++++++++++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-embed.c b/src/photos-embed.c
index 14f886c..36864e6 100644
--- a/src/photos-embed.c
+++ b/src/photos-embed.c
@@ -207,6 +207,7 @@ photos_embed_prepare_for_preview (PhotosEmbed *self)
*/
photos_spinner_box_stop (PHOTOS_SPINNER_BOX (priv->spinner_box));
+ photos_preview_view_set_node (PHOTOS_PREVIEW_VIEW (priv->preview), NULL);
gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "preview");
}
diff --git a/src/photos-preview-view.c b/src/photos-preview-view.c
index ca38c54..c642cd9 100644
--- a/src/photos-preview-view.c
+++ b/src/photos-preview-view.c
@@ -373,15 +373,24 @@ photos_preview_view_set_node (PhotosPreviewView *self, GeglNode *node)
if (priv->node == node)
return;
+ view = gtk_stack_get_visible_child (GTK_STACK (priv->stack));
g_clear_object (&priv->node);
+
if (node == NULL)
- return;
+ {
+ gtk_container_remove (GTK_CONTAINER (priv->stack), view);
- priv->node = g_object_ref (node);
- view = gtk_stack_get_visible_child (GTK_STACK (priv->stack));
- photos_preview_view_scale_and_align_image (self, view);
+ view = photos_preview_view_create_view (self);
+ gtk_container_add (GTK_CONTAINER (priv->stack), view);
+ }
+ else
+ {
+ priv->node = g_object_ref (node);
- /* Steals the reference to the GeglNode. */
- gegl_gtk_view_set_node (GEGL_GTK_VIEW (view), g_object_ref (priv->node));
- gtk_widget_queue_draw (view);
+ photos_preview_view_scale_and_align_image (self, view);
+
+ /* Steals the reference to the GeglNode. */
+ gegl_gtk_view_set_node (GEGL_GTK_VIEW (view), g_object_ref (priv->node));
+ gtk_widget_queue_draw (view);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]