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

example: Put the content in a scrolled window

This ensures the example can fit windows of any height.

This also makes the stack containing the content non vertically
homogeneous so the scrollbar appears only on examples needing it, while
keeping it horizontally homogeneous for to keep when the leaflets will
be folded consistent.
parent d8189a64
Pipeline #2504 passed with stage
in 2 minutes and 54 seconds
...@@ -112,7 +112,7 @@ example_window_notify_visible_child_cb (GObject *sender, ...@@ -112,7 +112,7 @@ example_window_notify_visible_child_cb (GObject *sender,
GParamSpec *pspec, GParamSpec *pspec,
ExampleWindow *self) ExampleWindow *self)
{ {
hdy_leaflet_set_visible_child (self->content_box, GTK_WIDGET (self->stack)); hdy_leaflet_set_visible_child_name (self->content_box, "content");
update_header_bar (self); update_header_bar (self);
} }
...@@ -120,7 +120,7 @@ static void ...@@ -120,7 +120,7 @@ static void
example_window_back_clicked_cb (GtkWidget *sender, example_window_back_clicked_cb (GtkWidget *sender,
ExampleWindow *self) ExampleWindow *self)
{ {
hdy_leaflet_set_visible_child (self->content_box, GTK_WIDGET (self->sidebar)); hdy_leaflet_set_visible_child_name (self->content_box, "sidebar");
} }
static void static void
...@@ -328,6 +328,6 @@ example_window_init (ExampleWindow *self) ...@@ -328,6 +328,6 @@ example_window_init (ExampleWindow *self)
gtk_widget_init_template (GTK_WIDGET (self)); gtk_widget_init_template (GTK_WIDGET (self));
gtk_list_box_set_header_func (self->column_listbox, list_box_separator_header_func, NULL, NULL); gtk_list_box_set_header_func (self->column_listbox, list_box_separator_header_func, NULL, NULL);
hdy_leaflet_set_visible_child (self->content_box, GTK_WIDGET (self->stack)); hdy_leaflet_set_visible_child_name (self->content_box, "content");
update_header_bar (self); update_header_bar (self);
} }
This diff is collapsed.
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