From fd0fa57ae247a1e425e9476af536b72d48e8956c Mon Sep 17 00:00:00 2001 From: David Bliss Date: Thu, 28 Mar 2024 08:39:29 +0000 Subject: [PATCH] Top buttons should be wide --- src/app.rs | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/app.rs b/src/app.rs index 97356d15..8453b899 100644 --- a/src/app.rs +++ b/src/app.rs @@ -116,14 +116,16 @@ impl SimpleComponent for App { adw::NavigationPage { set_tag: Some("time_period_views"), - gtk::Box { - set_orientation: gtk::Orientation::Vertical, + adw::ToolbarView { + + #[name = "header_bar"] + add_top_bar = &adw::HeaderBar { + set_hexpand: true, - #[name(header_bar)] - adw::HeaderBar { #[wrap(Some)] set_title_widget = &adw::ViewSwitcher { set_stack: Some(&stack), + set_policy: adw::ViewSwitcherPolicy::Wide, }, pack_end = >k::MenuButton { @@ -132,17 +134,22 @@ impl SimpleComponent for App { } }, - #[name(stack)] - adw::ViewStack { - add_titled_with_icon[None, "All", "playlist-infinite-symbolic"] = model.all_photos.widget(), - add_titled_with_icon[None, "Month", "month-symbolic"] = model.month_photos.widget(), - add_titled_with_icon[None, "Year", "year-symbolic"] = model.year_photos.widget(), - }, + #[wrap(Some)] + set_content = >k::Box { + set_orientation: gtk::Orientation::Vertical, - #[name(switcher_bar)] - adw::ViewSwitcherBar { - set_stack: Some(&stack), - } + #[name(stack)] + adw::ViewStack { + add_titled_with_icon[None, "All", "playlist-infinite-symbolic"] = model.all_photos.widget(), + add_titled_with_icon[None, "Month", "month-symbolic"] = model.month_photos.widget(), + add_titled_with_icon[None, "Year", "year-symbolic"] = model.year_photos.widget(), + }, + + #[name(switcher_bar)] + adw::ViewSwitcherBar { + set_stack: Some(&stack), + }, + }, }, },