[gnome-software] Add a shadow around the update details



commit 97f09213a73bd0cd47f6446c960878223854bfa4
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Sep 1 00:33:11 2013 -0400

    Add a shadow around the update details
    
    Add the shadow back, but only if the text is scrolling.

 src/gs-shell-updates.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 6746aa4..7653e6c 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -464,9 +464,15 @@ gs_shell_updates_button_update_all_cb (GtkButton      *button,
         g_object_unref (bus);
 }
 
-/**
- * gs_shell_updates_setup:
- */
+static void
+scrollbar_mapped_cb (GtkWidget *sb, GtkScrolledWindow *swin)
+{
+        if (gtk_widget_get_mapped (GTK_WIDGET (sb)))
+                gtk_scrolled_window_set_shadow_type (swin, GTK_SHADOW_IN);
+        else
+                gtk_scrolled_window_set_shadow_type (swin, GTK_SHADOW_NONE);
+}
+
 void
 gs_shell_updates_setup (GsShellUpdates *shell_updates,
                         GsShell *shell,
@@ -479,6 +485,7 @@ gs_shell_updates_setup (GsShellUpdates *shell_updates,
        GtkTreeViewColumn *column;
        GtkTreeView *treeview;
        GtkWidget *widget;
+        GtkWidget *sw;
 
        g_return_if_fail (GS_IS_SHELL_UPDATES (shell_updates));
 
@@ -546,6 +553,10 @@ gs_shell_updates_setup (GsShellUpdates *shell_updates,
        g_signal_connect (widget, "clicked",
                          G_CALLBACK (gs_shell_updates_button_back_cb),
                          shell_updates);
+       sw = GTK_WIDGET (gtk_builder_get_object (priv->builder, "scrolledwindow_update_details"));
+        widget = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (sw));
+        g_signal_connect (widget, "map", G_CALLBACK (scrollbar_mapped_cb), sw);
+        g_signal_connect (widget, "unmap", G_CALLBACK (scrollbar_mapped_cb), sw);
 }
 
 /**


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