From f2b58a7a56e98304f6680f07f98b6c24a4e1e473 Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Thu, 13 Dec 2018 09:23:12 +0100 Subject: [PATCH] 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. --- examples/example-window.c | 6 +- examples/example-window.ui | 983 +++++++++++++++++++------------------ 2 files changed, 498 insertions(+), 491 deletions(-) diff --git a/examples/example-window.c b/examples/example-window.c index 3562c03d..2db8defd 100644 --- a/examples/example-window.c +++ b/examples/example-window.c @@ -112,7 +112,7 @@ example_window_notify_visible_child_cb (GObject *sender, GParamSpec *pspec, 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); } @@ -120,7 +120,7 @@ static void example_window_back_clicked_cb (GtkWidget *sender, 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 @@ -328,6 +328,6 @@ example_window_init (ExampleWindow *self) gtk_widget_init_template (GTK_WIDGET (self)); 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); } diff --git a/examples/example-window.ui b/examples/example-window.ui index 7bcd2428..5d60ceda 100644 --- a/examples/example-window.ui +++ b/examples/example-window.ui @@ -152,57 +152,34 @@ - + + never True - False - - + True False - center - center - vertical + False + - + True False + center center - 18 - 128 - phone-symbolic - 0 - - - - False - True - 0 - - - - - True - False vertical - 12 - 12 - + True False - 0.5 - center - 12 - Welcome to Handy - center - True - - - - + center + 18 + 128 + phone-symbolic + 0 + False @@ -211,14 +188,49 @@ - + True False - 0.5 - This is a tour of the widgets the library has to offer. - center - True - True + vertical + 12 + 12 + + + True + False + 0.5 + center + 12 + Welcome to Handy + center + True + + + + + + + False + True + 0 + + + + + True + False + 0.5 + This is a tour of the widgets the library has to offer. + center + True + True + + + False + True + 1 + + False @@ -228,419 +240,339 @@ - False - True - 1 + welcome + Welcome - - - welcome - Welcome - - - - - True - False - 300 - 300 - 32 - 32 - 12 - 12 - + True False - center - True - vertical - 12 + 300 + 300 + 32 + 32 + 12 + 12 - + True False - True - - - - - - False - True - 0 - - - - - True - False - 10 - True - 8 center - - - + True + vertical + 12 + + + True + False + True + + + + + + False + True + 0 + + + + + True + False + 10 + True + 8 + center + + + + + + False + True + 1 + + - - False - True - 1 - - - - - dialer - Dialer - 1 - - - - - True - False - center - center - vertical - - - True - False - center - center - 3 - - False - True - 0 + dialer + Dialer + 1 - + True False - 6 - 3 - - - True - False - Number of arrows - - - 0 - 1 - - + center + center + vertical - + True False - Animation duration - - - 0 - 2 - - - - - True - True - 0 - digits - adj_arrows_count - 1 - True - True - - - 1 - 1 - - - - - True - True - digits - adj_arrows_duration - 250 - True - True - 1000 + center + center + 3 - 1 - 2 + False + True + 0 - + True False - 0 - out + 6 + 3 + + + True + False + Number of arrows + + + 0 + 1 + + + + + True + False + Animation duration + + + 0 + 2 + + + + + True + True + 0 + digits + adj_arrows_count + 1 + True + True + + + 1 + 1 + + + + + True + True + digits + adj_arrows_duration + 250 + True + True + 1000 + + + 1 + 2 + + - + True False - 12 + 0 + out - + True False - vertical - start - - - Up - True - True - False - True - True - - - - True - True - 0 - - - - - Down - True - True - False - True - btn_arrows_up - - - - True - True - 1 - - - - - Left - True - True - False - True - btn_arrows_up - - - - True - True - 2 - - + 12 - - Right + True - True - False - True - btn_arrows_up - + False + vertical + start + + + Up + True + True + False + True + True + + + + True + True + 0 + + + + + Down + True + True + False + True + btn_arrows_up + + + + True + True + 1 + + + + + Left + True + True + False + True + btn_arrows_up + + + + True + True + 2 + + + + + Right + True + True + False + True + btn_arrows_up + + + + True + True + 3 + + - - True - True - 3 - + + + - - - + + 0 + 0 + 2 + - 0 - 0 - 2 + False + True + 1 - False - True - 1 + arrows + Arrows + 2 - - - arrows - Arrows - 2 - - - - - True - False - fill - fill - 32 - 12 - 12 - 32 - True - - - + True - vertical False - start + fill + fill + 32 + 12 + 12 + 32 True + + True vertical False - center - center - 32 + start True - - - True - False - center - 128 - edit-select-symbolic - 0 - 18 - - - - False - True - - True vertical + False + center + center + 32 + True - - True - 0.5 - False - Column - center - 0 - 12 - - - - - - - False - True - - - - + True - 0.5 False - This column smoothly grows up to a maximum width. - center - true - True + center + 128 + edit-select-symbolic + 0 + 18 + False True - - - False - True - - - - - - - True - False - True - Column - left - start - 12 - - - - - - - - True - False - True - 32 - - - True - False - True - none True - False - True - horizontal + vertical True + 0.5 False - Maximum width + Column + center 0 - 18 - 20 - 6 - 18 - end + 12 + + + + - True + False True - + True + 0.5 False - 1 - 18 - 20 - 20 - 18 - column_width_adjustment + This column smoothly grows up to a maximum width. + center + true + True False @@ -648,45 +580,120 @@ + + False + True + + + + + + True + False + True + Column + left + start + 12 + + + + + + + + True + False + True + 32 - + True False True - horizontal + none - + True False - Linear growth width - 0 - 18 - 20 - 6 - 18 - end - - True - True - + horizontal + + + True + False + Maximum width + 0 + 18 + 20 + 6 + 18 + end + + + True + True + + + + + True + False + 1 + 18 + 20 + 20 + 18 + column_width_adjustment + + + False + True + + + - + True False - 1 - 18 - 20 - 20 - 18 - column_linear_width_adjustment + True + horizontal + + + True + False + Linear growth width + 0 + 18 + 20 + 6 + 18 + end + + + True + True + + + + + True + False + 1 + 18 + 20 + 20 + 18 + column_linear_width_adjustment + + + False + True + + - - False - True - @@ -695,88 +702,58 @@ + + column + Column + - - - column - Column - - - - - True - False - - + + True False - fill - start - True - True - - + + True + False + fill + start True - 600 + True - + True True + 600 + + + True + True + + - - - - - True - False - center - center - True - vertical - - - True - False - center - 18 - 128 - edit-find-symbolic - 0 - - - - False - True - 0 - - True False + center + center + True vertical - 12 - 12 - + True False - 0.5 - center - 12 - Search bar - center - True - - - - + center + 18 + 128 + edit-find-symbolic + 0 + False @@ -785,15 +762,66 @@ - + True False - 0.5 - 6 - A search bar that gives your search entry all the space it needs. - center - True - True + vertical + 12 + 12 + + + True + False + 0.5 + center + 12 + Search bar + center + True + + + + + + + False + True + 0 + + + + + True + False + 0.5 + 6 + A search bar that gives your search entry all the space it needs. + center + True + True + + + False + True + 1 + + + + + True + False + 0.5 + Try using it with an horizontaly expanded column to make your search entry adaptive. + center + True + True + + + False + True + 2 + + False @@ -801,36 +829,15 @@ 1 - - - True - False - 0.5 - Try using it with an horizontaly expanded column to make your search entry adaptive. - center - True - True - - - False - True - 2 - - - - False - True - 1 - + + search-bar + Search bar + - - search-bar - Search bar - -- GitLab