[gnome-photos] Simplify showing the preview controls for the first time



commit 949246eab98663c8d84d575cbe785f982f4c5de0
Author: Debarshi Ray <debarshir gnome org>
Date:   Sun Mar 1 01:26:41 2015 +0100

    Simplify showing the preview controls for the first time
    
    Showing the controls requires having the model, which is independent
    from loading the pixels and setting the GeglNode. We already have the
    model. Therefore, call the show method immediately after setting the
    model.

 src/photos-preview-nav-buttons.c |    2 --
 src/photos-preview-view.c        |    5 +++--
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-preview-nav-buttons.c b/src/photos-preview-nav-buttons.c
index 44e6bc4..bbe39ef 100644
--- a/src/photos-preview-nav-buttons.c
+++ b/src/photos-preview-nav-buttons.c
@@ -599,8 +599,6 @@ photos_preview_nav_buttons_set_model (PhotosPreviewNavButtons *self, GtkTreeMode
       priv->current_path = gtk_tree_model_filter_convert_child_path_to_path (GTK_TREE_MODEL_FILTER 
(priv->model),
                                                                              current_path);
     }
-
-  photos_preview_nav_buttons_update_visibility (self);
 }
 
 
diff --git a/src/photos-preview-view.c b/src/photos-preview-view.c
index 7de32c9..dc67713 100644
--- a/src/photos-preview-view.c
+++ b/src/photos-preview-view.c
@@ -362,7 +362,10 @@ photos_preview_view_load_previous (PhotosPreviewView *self)
 void
 photos_preview_view_set_model (PhotosPreviewView *self, GtkTreeModel *model, GtkTreePath *current_path)
 {
+  PhotosPreviewViewPrivate *priv = self->priv;
+
   photos_preview_nav_buttons_set_model (self->priv->nav_buttons, model, current_path);
+  photos_preview_nav_buttons_show (priv->nav_buttons);
 }
 
 
@@ -372,8 +375,6 @@ photos_preview_view_set_node (PhotosPreviewView *self, GeglNode *node)
   PhotosPreviewViewPrivate *priv = self->priv;
   GtkWidget *view;
 
-  photos_preview_nav_buttons_show (priv->nav_buttons);
-
   if (priv->node == node)
     return;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]