From b9fb7fcea4316669e1c24031248ca9622661454c Mon Sep 17 00:00:00 2001 From: jane400 Date: Thu, 19 Sep 2024 18:00:16 +0200 Subject: [PATCH] fix: paket: adjust viewswitcher in title --- paket/src/ready.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/paket/src/ready.rs b/paket/src/ready.rs index 26dbc60..ea6c6d1 100644 --- a/paket/src/ready.rs +++ b/paket/src/ready.rs @@ -63,11 +63,14 @@ impl Component for Ready { #[wrap(Some)] set_child = &adw::NavigationView { add = &adw::NavigationPage { + set_title: "", + #[wrap(Some)] set_child = &adw::ToolbarView { add_top_bar = ready_headerbar = &adw::HeaderBar { #[wrap(Some)] set_title_widget = ready_switchertop = &adw::ViewSwitcher{ + set_policy: adw::ViewSwitcherPolicy::Wide, set_stack: Some(&ready_view_stack), } }, @@ -161,30 +164,26 @@ impl Component for Ready { }); } - let breakpoint_0 = adw::Breakpoint::new(adw::BreakpointCondition::new_length( + let breakpoint = adw::Breakpoint::new(adw::BreakpointCondition::new_length( adw::BreakpointConditionLengthType::MaxWidth, - 480.0, - adw::LengthUnit::Sp, - )); - let breakpoint_1 = adw::Breakpoint::new(adw::BreakpointCondition::new_length( - adw::BreakpointConditionLengthType::MaxWidth, - 480.0, + 450.0, adw::LengthUnit::Sp, )); let widgets = view_output!(); - breakpoint_0.add_setter(widgets.ready_headerbar.widget_ref(), "title-widget", None); - sender - .output(ReadyOutput::AddBreakpoint(breakpoint_0)) - .unwrap(); - breakpoint_1.add_setter( + breakpoint.add_setter( + widgets.ready_headerbar.widget_ref(), + "show-title", + Some(>k::glib::Value::from(false)), + ); + breakpoint.add_setter( widgets.ready_switcherbar.widget_ref(), "reveal", Some(>k::glib::Value::from(true)), ); sender - .output(ReadyOutput::AddBreakpoint(breakpoint_1)) + .output(ReadyOutput::AddBreakpoint(breakpoint)) .unwrap(); ComponentParts { model, widgets }