forked from sergiotarxz/mangareader
Adding the previous button to the header bar.
This commit is contained in:
parent
aad5a1854b
commit
6b2bcb83cf
@ -42,16 +42,7 @@ activate (AdwApplication *app,
|
||||
adw_view_stack_set_visible_child_name (views_stack, "manga-list");
|
||||
AdwViewStackPage *page = adw_view_stack_get_page (views_stack, scroll);
|
||||
adw_view_stack_page_set_title (page, "Manga List");
|
||||
GtkWidget *application_controls = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0 );
|
||||
GtkWidget *previous = gtk_button_new_from_icon_name ("go-previous-symbolic");
|
||||
|
||||
GValue margin_left = G_VALUE_INIT;
|
||||
g_value_init (&margin_left, G_TYPE_INT);
|
||||
g_value_set_int(&margin_left, 10);
|
||||
g_object_set_property (G_OBJECT (previous), "margin-start", &margin_left);
|
||||
gtk_box_append (GTK_BOX (application_controls), previous);
|
||||
|
||||
gtk_box_append (box, application_controls);
|
||||
gtk_box_append (box, GTK_WIDGET (views_stack));
|
||||
|
||||
gtk_widget_show (window);
|
||||
@ -78,6 +69,13 @@ create_headerbar (GtkBox *box) {
|
||||
ADW_HEADER_BAR (header),
|
||||
GTK_WIDGET (title));
|
||||
gtk_box_append (box, header);
|
||||
GtkWidget *previous = gtk_button_new_from_icon_name ("go-previous-symbolic");
|
||||
|
||||
GValue margin_left = G_VALUE_INIT;
|
||||
g_value_init (&margin_left, G_TYPE_INT);
|
||||
g_value_set_int(&margin_left, 10);
|
||||
g_object_set_property (G_OBJECT (previous), "margin-start", &margin_left);
|
||||
adw_header_bar_pack_start (ADW_HEADER_BAR (header), previous);
|
||||
|
||||
|
||||
return ADW_HEADER_BAR (header);
|
||||
|
Loading…
Reference in New Issue
Block a user