Commit f479ea73 authored by Adrien Plazas's avatar Adrien Plazas
Browse files

librem5: updates-section: Make the header vertical

parent 441f546e
......@@ -436,7 +436,11 @@ _build_section_header (GsUpdatesSection *self)
}
/* create header */
header = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
header = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_widget_set_margin_start (header, 6);
gtk_widget_set_margin_end (header, 6);
gtk_widget_set_margin_top (header, 6);
gtk_widget_set_margin_bottom (header, 6);
context = gtk_widget_get_style_context (header);
gtk_style_context_add_class (context, "app-listbox-header");
......@@ -444,14 +448,15 @@ _build_section_header (GsUpdatesSection *self)
gtk_widget_set_hexpand (label, TRUE);
gtk_container_add (GTK_CONTAINER (header), label);
gtk_widget_set_visible (label, TRUE);
gtk_widget_set_margin_start (label, 6);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
context = gtk_widget_get_style_context (label);
gtk_style_context_add_class (context, "app-listbox-header-title");
/* use a stack so we can switch which buttons are showing without the
* sizegroup resizing */
self->button_stack = GTK_STACK (gtk_stack_new ());
gtk_widget_set_halign (GTK_WIDGET (self->button_stack), GTK_ALIGN_CENTER);
gtk_container_add (GTK_CONTAINER (header), GTK_WIDGET (self->button_stack));
gtk_container_child_set (GTK_CONTAINER (header), GTK_WIDGET (self->button_stack), "pack-type", GTK_PACK_END, NULL);
......@@ -466,7 +471,6 @@ _build_section_header (GsUpdatesSection *self)
self);
gtk_stack_add_named (self->button_stack, self->button_download, "download");
gtk_widget_set_visible (self->button_download, TRUE);
gtk_widget_set_margin_end (self->button_download, 6);
/* add update button */
self->button_update = gs_progress_button_new ();
......@@ -477,7 +481,6 @@ _build_section_header (GsUpdatesSection *self)
self);
gtk_stack_add_named (self->button_stack, self->button_update, "update");
gtk_widget_set_visible (self->button_update, TRUE);
gtk_widget_set_margin_end (self->button_update, 6);
/* add cancel button */
self->button_cancel = gs_progress_button_new ();
......
Markdown is supported
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