Commit 01f1d5fb authored by Matthias Clasen's avatar Matthias Clasen
Browse files

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.
parent 0b02d38c
......@@ -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>
......
......@@ -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);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment