update: use dyrend & use autosized window in app-list & fix button size in workspaces & only update popup text in time when creating popup

This commit is contained in:
Ashley Wulber 2023-01-20 11:25:53 -05:00
parent 9b229c6e72
commit 982b8f5fd1
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
6 changed files with 164 additions and 205 deletions

View file

@ -47,6 +47,7 @@ struct IcedWorkspacesApplet {
workspaces: WorkspaceList,
workspace_tx: Option<SyncSender<WorkspaceEvent>>,
layout: Layout,
helper: CosmicAppletHelper,
}
#[derive(Debug, Clone)]
@ -74,6 +75,7 @@ impl Application for IcedWorkspacesApplet {
theme: Default::default(),
workspaces: Vec::new(),
workspace_tx: Default::default(),
helper: Default::default(),
},
Command::none(),
)
@ -96,7 +98,7 @@ impl Application for IcedWorkspacesApplet {
Ordering::Greater => Ordering::Greater,
});
self.workspaces = list;
let unit = 32;
let unit = self.helper.suggested_size().0 as u32 + 16;
let (w, h) = match self.layout {
Layout::Row => (unit * self.workspaces.len().max(1) as u32, unit),
Layout::Column => (unit, unit * self.workspaces.len().max(1) as u32),