Added workaroud for toggle after separator crash

This commit is contained in:
András 2024-12-08 00:03:07 +02:00 committed by Michael Murphy
parent 9f9bb9c673
commit 7eb47a71b3

View file

@ -748,6 +748,9 @@ impl cosmic::Application for CosmicNetworkApplet {
.on_press(Message::OpenHwDevice(None)) .on_press(Message::OpenHwDevice(None))
] ]
} else { } else {
column![
// TODO: remove excesive column!
Element::from(
column![ column![
vpn_ethernet_col, vpn_ethernet_col,
padded_control( padded_control(
@ -762,7 +765,11 @@ impl cosmic::Application for CosmicNetworkApplet {
.text_size(14) .text_size(14)
.width(Length::Fill) .width(Length::Fill)
), ),
padded_control(divider::horizontal::default()).padding([space_xxs, space_s]), padded_control(divider::horizontal::default())
.padding([space_xxs, space_s]),
]
.align_x(Alignment::Center)
),
padded_control( padded_control(
anim!( anim!(
//toggler //toggler
@ -840,17 +847,13 @@ impl cosmic::Application for CosmicNetworkApplet {
.symbolic(true) .symbolic(true)
.into(), .into(),
); );
// todo figure our crash here. It happens if both this thing in content as well as
// there is no new connection and we are viewing available networks(see insertion
// of `list_col` into `content` on L1083)
content = content.push(Element::from( content = content.push(Element::from(
column![menu_button( menu_button(
Row::with_children(btn_content) Row::with_children(btn_content)
.align_y(Alignment::Center) .align_y(Alignment::Center)
.spacing(8) .spacing(8)
) )
.on_press(Message::OpenHwDevice(Some(hw_device.clone())))] .on_press(Message::OpenHwDevice(Some(hw_device.clone()))),
.align_x(Alignment::Center),
)); ));
} }
@ -1077,9 +1080,6 @@ impl cosmic::Application for CosmicNetworkApplet {
.on_press(Message::SelectWirelessAccessPoint(ap.clone())); .on_press(Message::SelectWirelessAccessPoint(ap.clone()));
list_col.push(button.into()); list_col.push(button.into());
} }
// todo fixup crash that happens if both content gets update here and with such
// condition `if wireless_hw_devices.len() > 1 && self.hw_device_to_show.is_none()`
// See reference to it on L843
content = content content = content
.push(scrollable(Column::with_children(list_col)).height(Length::Fixed(300.0))); .push(scrollable(Column::with_children(list_col)).height(Length::Fixed(300.0)));
} }