[gnome-photos] preview-nav-buttons: Don't obstruct LoadMoreButton



commit 470c05cd5349937e793467c26af27906a4ed43e3
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Aug 9 16:07:11 2013 +0200

    preview-nav-buttons: Don't obstruct LoadMoreButton
    
    When fading out, it is not enough to just unreveal the widgets. We
    should actually hide the GtkRevealer too, so that it doesn't obstruct
    others by staying in the GtkOverlay. eg., if we don't hide the one
    used for the toolbar, it will block the LoadMoreButton.

 src/photos-preview-nav-buttons.c |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/src/photos-preview-nav-buttons.c b/src/photos-preview-nav-buttons.c
index e312c28..c1ad36f 100644
--- a/src/photos-preview-nav-buttons.c
+++ b/src/photos-preview-nav-buttons.c
@@ -87,15 +87,33 @@ photos_preview_nav_buttons_fade_in_button (PhotosPreviewNavButtons *self, GtkWid
   if (priv->model == NULL || priv->current_path == NULL)
     return;
 
-
+  gtk_widget_show_all (widget);
   gtk_revealer_set_reveal_child (GTK_REVEALER (widget), TRUE);
 }
 
 
 static void
+photos_preview_nav_buttons_notify_child_revealed (PhotosPreviewNavButtons *self,
+                                                  GParamSpec *pspec,
+                                                  gpointer user_data)
+{
+  GtkWidget *widget = GTK_WIDGET (user_data);
+
+  if (!gtk_revealer_get_child_revealed (GTK_REVEALER (widget)))
+      gtk_widget_hide (widget);
+
+  g_signal_handlers_disconnect_by_func (widget, photos_preview_nav_buttons_notify_child_revealed, self);
+}
+
+
+static void
 photos_preview_nav_buttons_fade_out_button (PhotosPreviewNavButtons *self, GtkWidget *widget)
 {
   gtk_revealer_set_reveal_child (GTK_REVEALER (widget), FALSE);
+  g_signal_connect_swapped (widget,
+                            "notify::child-revealed",
+                            G_CALLBACK (photos_preview_nav_buttons_notify_child_revealed),
+                            self);
 }
 
 
@@ -436,10 +454,6 @@ photos_preview_nav_buttons_constructed (GObject *object)
                             "motion-notify-event",
                             G_CALLBACK (photos_preview_nav_buttons_motion_notify),
                             self);
-
-  gtk_widget_show_all (priv->prev_widget);
-  gtk_widget_show_all (priv->next_widget);
-  gtk_widget_show_all (priv->toolbar_widget);
 }
 
 


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