Skip to content

Commit

Permalink
Top buttons should be wide
Browse files Browse the repository at this point in the history
  • Loading branch information
blissd committed Mar 28, 2024
1 parent 5833cb6 commit fd0fa57
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = &gtk::MenuButton {
Expand All @@ -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 = &gtk::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),
},
},
},
},

Expand Down

0 comments on commit fd0fa57

Please sign in to comment.