fix: use fixed window width for all applets

This commit is contained in:
Ashley Wulber 2025-03-04 13:25:10 -05:00 committed by Ashley Wulber
parent 9b09c97665
commit 61d1d1b91d
11 changed files with 12 additions and 91 deletions

View file

@ -150,11 +150,6 @@ impl cosmic::Application for CosmicA11yApplet {
None,
None,
);
popup_settings.positioner.size_limits = Limits::NONE
.max_width(300.0)
.min_width(200.0)
.min_height(10.0)
.max_height(1080.0);
return get_popup(popup_settings);
}
@ -267,12 +262,7 @@ impl cosmic::Application for CosmicA11yApplet {
menu_button(text::body(fl!("settings"))).on_press(Message::OpenSettings)
]
.padding([8, 0]);
self.core
.applet
.popup_container(content_list)
.max_width(372.)
.max_height(600.)
.into()
self.core.applet.popup_container(content_list).into()
}
fn subscription(&self) -> Subscription<Message> {

View file

@ -363,11 +363,6 @@ impl cosmic::Application for Audio {
None,
None,
);
popup_settings.positioner.size_limits = Limits::NONE
.min_height(1.0)
.min_width(1.0)
.max_width(400.0)
.max_height(1080.0);
if let Some(conn) = self.pulse_state.connection() {
conn.send(pulse::Message::GetDefaultSink);
@ -970,11 +965,7 @@ impl cosmic::Application for Audio {
.align_x(Alignment::Start)
.padding([8, 0]);
self.core
.applet
.popup_container(container(content))
.limits(Limits::NONE.max_width(400.))
.into()
self.core.applet.popup_container(container(content)).into()
}
fn on_close_requested(&self, id: window::Id) -> Option<Message> {

View file

@ -354,11 +354,6 @@ impl cosmic::Application for CosmicBatteryApplet {
None,
None,
);
popup_settings.positioner.size_limits = Limits::NONE
.max_width(372.0)
.min_width(300.0)
.min_height(200.0)
.max_height(1080.0);
if let Some(tx) = self.power_profile_sender.as_ref() {
let _ = tx.send(PowerProfileRequest::Get);
}
@ -826,8 +821,6 @@ impl cosmic::Application for CosmicBatteryApplet {
self.core
.applet
.popup_container(Column::with_children(content).padding([8, 0]))
.max_width(372.)
.max_height(600.)
.into()
}

View file

@ -140,16 +140,11 @@ impl cosmic::Application for CosmicBluetoothApplet {
let mut popup_settings = self.core.applet.get_popup_settings(
self.core.main_window_id().unwrap(),
new_id,
Some((1, 1)),
None,
None,
None,
);
popup_settings.positioner.size_limits = Limits::NONE
.min_height(1.0)
.min_width(1.0)
.max_height(800.0)
.max_width(400.0);
let tx = self.bluer_sender.as_ref().cloned();
return Task::batch(vec![
iced::Task::perform(

View file

@ -157,11 +157,7 @@ impl cosmic::Application for Window {
None,
None,
);
popup_settings.positioner.size_limits = Limits::NONE
.max_width(372.0)
.min_width(300.0)
.min_height(1.)
.max_height(1080.0);
get_popup(popup_settings)
};
}
@ -274,17 +270,7 @@ impl cosmic::Application for Window {
.on_press(Message::KeyboardSettings),
);
self.core
.applet
.popup_container(content_list)
.limits(
Limits::NONE
.min_height(1.)
.max_height(1080.)
.min_width(1.)
.max_width(372.),
)
.into()
self.core.applet.popup_container(content_list).into()
}
fn subscription(&self) -> Subscription<Self::Message> {

View file

@ -219,8 +219,6 @@ impl CosmicNetworkApplet {
self.core
.applet
.popup_container(content.padding([8, 0, 8, 0]))
.max_width(400.)
.max_height(800.)
.into()
}
}
@ -310,11 +308,6 @@ impl cosmic::Application for CosmicNetworkApplet {
None,
);
popup_settings.positioner.size_limits = Limits::NONE
.min_height(1.0)
.min_width(1.0)
.max_height(800.0)
.max_width(400.0);
if let Some(tx) = self.nm_sender.as_mut() {
let _ = tx.unbounded_send(NetworkManagerRequest::Reload);
}

View file

@ -216,11 +216,7 @@ impl cosmic::Application for Notifications {
None,
None,
);
popup_settings.positioner.size_limits = Limits::NONE
.min_width(1.0)
.max_width(444.0)
.min_height(100.0)
.max_height(900.0);
return get_popup(popup_settings);
}
}
@ -623,11 +619,7 @@ impl cosmic::Application for Notifications {
.align_x(Alignment::Start)
.padding([8, 0]);
self.core
.applet
.popup_container(content)
.limits(Limits::NONE.max_width(444.).max_height(900.))
.into()
self.core.applet.popup_container(content).into()
}
fn on_close_requested(&self, id: window::Id) -> Option<Message> {

View file

@ -144,15 +144,11 @@ impl cosmic::Application for Power {
let mut popup_settings = self.core.applet.get_popup_settings(
self.core.main_window_id().unwrap(),
new_id,
Some((500, 500)),
None,
None,
None,
);
popup_settings.positioner.size_limits = Limits::NONE
.min_width(100.0)
.min_height(100.0)
.max_height(400.0)
.max_width(500.0);
get_popup(popup_settings)
}
}
@ -269,12 +265,7 @@ impl cosmic::Application for Power {
.align_x(Alignment::Start)
.padding([8, 0]);
self.core
.applet
.popup_container(content)
.max_height(400.)
.max_width(500.)
.into()
self.core.applet.popup_container(content).into()
} else {
//panic!("no view for window {}", id.0)
widget::text("").into()

View file

@ -303,7 +303,6 @@ impl cosmic::Application for App {
container(menu.popup_view().map(move |msg| Msg::StatusMenu((id, msg))))
.padding([pad, 0.]),
)
.limits(Limits::NONE.min_width(1.).min_height(1.).max_width(300.))
.into(),
None => unreachable!(),
},

View file

@ -195,11 +195,7 @@ impl cosmic::Application for Window {
None,
None,
);
popup_settings.positioner.size_limits = Limits::NONE
.max_width(400.0)
.min_width(300.0)
.min_height(200.0)
.max_height(1080.0);
get_popup(popup_settings)
}
}
@ -368,11 +364,7 @@ impl cosmic::Application for Window {
]
.padding([8, 0]);
self.core
.applet
.popup_container(content_list)
.max_width(400.)
.into()
self.core.applet.popup_container(content_list).into()
}
fn style(&self) -> Option<cosmic::iced_runtime::Appearance> {

View file

@ -677,7 +677,6 @@ impl cosmic::Application for Window {
self.core
.applet
.popup_container(container(content_list))
.max_width(300.)
.into()
}