This commit is contained in:
Samuel Onoja committed 2026-10-01 23:42:40 +01:00
1 parent da60ecb719
commit 42f022fde5
4 files changed
+124 -120

No files matched your search

+27 -27
View File
@@ -359,6 +359,33 @@ impl Default for WorkspaceSet {
}
impl WorkspaceSet {
pub fn new(
default_layout_mode: LayoutMode,
default_column_width: ColumnWidth,
scrolling_focus_strategy: ViewportFocusStrategy,
) -> Self {
let active = WorkspaceId(1);
let workspace = Workspace {
id: active,
layout: WorkspaceLayout::new(default_layout_mode, default_column_width, scrolling_focus_strategy),
floating: Vec::new(),
last_focused: None,
fullscreen: None,
};
let workspaces = HashMap::from([(active, workspace)]);
Self {
active,
workspaces,
window_workspaces: HashMap::new(),
placements: HashMap::new(),
default_layout_mode,
default_column_width,
scrolling_focus_strategy,
next_id: 2,
}
}
pub fn reconfigure_live(
&mut self,
mode: LayoutMode,
@@ -428,33 +455,6 @@ impl WorkspaceSet {
}
}
pub fn new(
default_layout_mode: LayoutMode,
default_column_width: ColumnWidth,
scrolling_focus_strategy: ViewportFocusStrategy,
) -> Self {
let active = WorkspaceId(1);
let workspace = Workspace {
id: active,
layout: WorkspaceLayout::new(default_layout_mode, default_column_width, scrolling_focus_strategy),
floating: Vec::new(),
last_focused: None,
fullscreen: None,
};
let workspaces = HashMap::from([(active, workspace)]);
Self {
active,
workspaces,
window_workspaces: HashMap::new(),
placements: HashMap::new(),
default_layout_mode,
default_column_width,
scrolling_focus_strategy,
next_id: 2,
}
}
pub fn active_id(&self) -> WorkspaceId {
self.active
}