feat(workspace): add option for moving the tab close button to the left

This commit is contained in:
Alex Viscreanu 2023-07-17 21:17:04 +02:00
parent 6793d4b6b8
commit 4efcf492ee
No known key found for this signature in database
4 changed files with 107 additions and 72 deletions

View file

@ -33,11 +33,30 @@ use theme::Theme;
#[derive(Deserialize)]
pub struct ItemSettings {
pub git_status: bool,
pub close_position: ClosePosition,
}
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "lowercase")]
pub enum ClosePosition {
Left,
#[default]
Right,
}
impl ClosePosition {
pub fn right(&self) -> bool {
match self {
ClosePosition::Left => false,
ClosePosition::Right => true,
}
}
}
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema)]
pub struct ItemSettingsContent {
git_status: Option<bool>,
close_position: Option<ClosePosition>,
}
impl Setting for ItemSettings {