[gnome-software] Improve appearance of the update details list



commit 01f1d5fb5a04892e4fad7b82f22e15b424f2b37f
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Sep 20 22:18:04 2013 -0400

    Improve appearance of the update details list
    
    The listbox was missing a separator after the last list. Instead
    of adding that, change to the frame/scrollbar trick we're using
    elsewhere to make lists grow a scrollbar only when needed.

 src/gnome-software.ui  |   19 +++++++++++++++----
 src/gs-shell-updates.c |   18 ++++++++++++++++--
 2 files changed, 31 insertions(+), 6 deletions(-)
---
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index a6ba960..e9fa0d7 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -1162,13 +1162,24 @@
                 <property name="vexpand">True</property>
                 <property name="hscrollbar_policy">never</property>
                 <property name="hscrollbar_policy">automatic</property>
-                <property name="shadow_type">in</property>
+                <property name="shadow_type">none</property>
                 <property name="kinetic_scrolling">False</property>
                 <child>
-                  <object class="GtkListBox" id="list_box_update">
+                  <object class="GtkFrame" id="box_update_frame">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="selection_mode">none</property>
+                    <property name="shadow_type">in</property>
+                    <property name="halign">fill</property>
+                    <property name="valign">start</property>
+                    <style>
+                      <class name="view"/>
+                    </style>
+                    <child>
+                      <object class="GtkListBox" id="list_box_update">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="selection_mode">none</property>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index a1e937e..0fac3da 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -483,10 +483,19 @@ gs_shell_updates_button_update_all_cb (GtkButton      *button,
 static void
 scrollbar_mapped_cb (GtkWidget *sb, GtkScrolledWindow *swin)
 {
-       if (gtk_widget_get_mapped (GTK_WIDGET (sb)))
+        GtkWidget *frame;
+
+        frame = gtk_bin_get_child (GTK_BIN (gtk_bin_get_child (GTK_BIN (swin))));
+
+       if (gtk_widget_get_mapped (GTK_WIDGET (sb))) {
                gtk_scrolled_window_set_shadow_type (swin, GTK_SHADOW_IN);
-       else
+               if (GTK_IS_FRAME (frame))
+                       gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
+       } else {
+               if (GTK_IS_FRAME (frame))
+                       gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
                gtk_scrolled_window_set_shadow_type (swin, GTK_SHADOW_NONE);
+       }
 }
 
 static void
@@ -556,6 +565,11 @@ gs_shell_updates_setup (GsShellUpdates *shell_updates,
        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);
+
+       sw = GTK_WIDGET (gtk_builder_get_object (priv->builder, "scrolledwindow_update"));
+       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]