-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Use cosmic-config for workspace settings
`WorkspaceAmount` now can be changed dynamically, which seems to basically work. We'll see how that works with `WorkspaceMode` and `WorkspaceLayout`. If `WorkspaceLayout` can be changed at runtime, we'll have to update default keybindings in some way.
- Loading branch information
Showing
7 changed files
with
103 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
use serde::{Deserialize, Serialize}; | ||
|
||
fn default_workspace_layout() -> WorkspaceLayout { | ||
WorkspaceLayout::Vertical | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
pub struct WorkspaceConfig { | ||
pub workspace_mode: WorkspaceMode, | ||
pub workspace_amount: WorkspaceAmount, | ||
#[serde(default = "default_workspace_layout")] | ||
pub workspace_layout: WorkspaceLayout, | ||
} | ||
|
||
impl Default for WorkspaceConfig { | ||
fn default() -> Self { | ||
Self { | ||
workspace_mode: WorkspaceMode::Global, | ||
workspace_amount: WorkspaceAmount::Dynamic, | ||
workspace_layout: WorkspaceLayout::Vertical, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] | ||
pub enum WorkspaceAmount { | ||
Dynamic, | ||
Static(u8), | ||
} | ||
|
||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] | ||
pub enum WorkspaceMode { | ||
OutputBound, | ||
Global, | ||
} | ||
|
||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] | ||
pub enum WorkspaceLayout { | ||
Vertical, | ||
Horizontal, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters