Skip to content

Commit 08b9961

Browse files
committed
feat(Workspace): add definition for thumbnail placements
1 parent b8c429f commit 08b9961

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

cosmic-comp-config/src/workspace.rs

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,35 @@
22

33
use serde::{Deserialize, Serialize};
44

5-
fn default_workspace_layout() -> WorkspaceLayout {
6-
WorkspaceLayout::Vertical
7-
}
8-
9-
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5+
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
106
pub struct WorkspaceConfig {
117
pub workspace_mode: WorkspaceMode,
12-
#[serde(default = "default_workspace_layout")]
8+
#[serde(default)]
139
pub workspace_layout: WorkspaceLayout,
10+
pub workspace_thumbnail_placement: WorkspaceThumbnailPlacement,
1411
}
1512

16-
impl Default for WorkspaceConfig {
17-
fn default() -> Self {
18-
Self {
19-
workspace_mode: WorkspaceMode::OutputBound,
20-
workspace_layout: WorkspaceLayout::Vertical,
21-
}
22-
}
23-
}
24-
25-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
13+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
2614
pub enum WorkspaceMode {
15+
#[default]
2716
OutputBound,
2817
Global,
2918
}
3019

31-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
20+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
21+
#[repr(usize)]
22+
pub enum WorkspaceThumbnailPlacement {
23+
Top = 0,
24+
Bottom = 1,
25+
#[default]
26+
Left = 2,
27+
Right = 3,
28+
}
29+
30+
31+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
3232
pub enum WorkspaceLayout {
33+
#[default]
3334
Vertical,
3435
Horizontal,
3536
}

0 commit comments

Comments
 (0)