refactor: config improvements

This commit is contained in:
Ashley Wulber 2024-01-18 19:01:11 -05:00
parent 994e93d6d2
commit 9e82cca922
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
7 changed files with 71 additions and 89 deletions

View file

@ -13,7 +13,6 @@ const ID: &str = "com.system76.CosmicAppletExample";
pub struct Window {
core: Core,
popup: Option<Id>,
id_ctr: u128,
example_row: bool,
}
@ -59,13 +58,12 @@ impl cosmic::Application for Window {
return if let Some(p) = self.popup.take() {
destroy_popup(p)
} else {
self.id_ctr += 1;
let new_id = Id(self.id_ctr);
let new_id = Id::unique();
self.popup.replace(new_id);
let mut popup_settings =
self.core
.applet
.get_popup_settings(Id(0), new_id, None, None, None);
.get_popup_settings(Id::MAIN, new_id, None, None, None);
popup_settings.positioner.size_limits = Limits::NONE
.max_width(372.0)
.min_width(300.0)