fix: paket: adjust viewswitcher in title

This commit is contained in:
jane400 2024-09-19 18:00:16 +02:00 committed by jane400
parent 87befa2f13
commit b9fb7fcea4

View file

@ -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(&gtk::glib::Value::from(false)),
);
breakpoint.add_setter(
widgets.ready_switcherbar.widget_ref(),
"reveal",
Some(&gtk::glib::Value::from(true)),
);
sender
.output(ReadyOutput::AddBreakpoint(breakpoint_1))
.output(ReadyOutput::AddBreakpoint(breakpoint))
.unwrap();
ComponentParts { model, widgets }