1
0
Fork 0
forked from wry/wry

autocommit 2022-04-24 17:15:41 CEST

This commit is contained in:
Julian Orth 2022-04-24 17:15:41 +02:00
parent 025efbaccc
commit cff35fd7da
5 changed files with 63 additions and 23 deletions

View file

@ -168,6 +168,29 @@ impl OutputNode {
true
}
pub fn create_workspace(self: &Rc<Self>, name: &str) -> Rc<WorkspaceNode> {
let ws = Rc::new(WorkspaceNode {
id: self.state.node_ids.next(),
output: CloneCell::new(self.clone()),
position: Cell::new(Default::default()),
container: Default::default(),
stacked: Default::default(),
seat_state: Default::default(),
name: name.to_string(),
output_link: Cell::new(None),
visible: Cell::new(false),
fullscreen: Default::default(),
});
ws.output_link
.set(Some(self.workspaces.add_last(ws.clone())));
self.state.workspaces.set(name.to_string(), ws.clone());
if self.workspace.get().is_none() {
self.show_workspace(&ws);
}
self.update_render_data();
ws
}
fn workspace_rect(&self) -> Rect {
let rect = self.global.pos.get();
let th = self.state.theme.title_height.get();