workspace: Add settings to dim inactive panes and highlight active pane (#18968)
Closes #12529 Closes #8639 Release Notes: - Added option to dim inactive panes ([#12529](https://github.com/zed-industries/zed/issues/12529)) - Added option to highlight active pane with a border ([#8639](https://github.com/zed-industries/zed/issues/8639)) BREAKING: `active_pane_magnification` value is no longer used, it should be migrated to `active_pane_modifiers.magnification`  > note: don't know much rust, so I wouldn't be surprised if stuff can be done much better, happy to update things after the review. Also, wasn't sure about introducing the new object in the settings, but it felt better than adding two more keys to the root, let me know what you think and if there's a better way to do this. Also happy to get feedback on the text itself, as I didn't spend much thinking how to document this.
This commit is contained in:
parent
b8501199c2
commit
bc3550d991
4 changed files with 108 additions and 18 deletions
|
@ -7,7 +7,7 @@ use settings::{Settings, SettingsSources};
|
|||
|
||||
#[derive(Deserialize)]
|
||||
pub struct WorkspaceSettings {
|
||||
pub active_pane_magnification: f32,
|
||||
pub active_pane_modifiers: ActivePanelModifiers,
|
||||
pub pane_split_direction_horizontal: PaneSplitDirectionHorizontal,
|
||||
pub pane_split_direction_vertical: PaneSplitDirectionVertical,
|
||||
pub centered_layout: CenteredLayoutSettings,
|
||||
|
@ -21,6 +21,30 @@ pub struct WorkspaceSettings {
|
|||
pub command_aliases: HashMap<String, String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub struct ActivePanelModifiers {
|
||||
/// Scale by which to zoom the active pane.
|
||||
/// When set to 1.0, the active pane has the same size as others,
|
||||
/// but when set to a larger value, the active pane takes up more space.
|
||||
///
|
||||
/// Default: `1.0`
|
||||
pub magnification: Option<f32>,
|
||||
/// Size of the border surrounding the active pane.
|
||||
/// When set to 0, the active pane doesn't have any border.
|
||||
/// The border is drawn inset.
|
||||
///
|
||||
/// Default: `0.0`
|
||||
pub border_size: Option<f32>,
|
||||
/// Opacity of inactive panels.
|
||||
/// When set to 1.0, the inactive panes have the same opacity as the active one.
|
||||
/// If set to 0, the inactive panes content will not be visible at all.
|
||||
/// Values are clamped to the [0.0, 1.0] range.
|
||||
///
|
||||
/// Default: `1.0`
|
||||
pub inactive_opacity: Option<f32>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Default, Serialize, Deserialize, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum CloseWindowWhenNoItems {
|
||||
|
@ -57,12 +81,8 @@ pub enum RestoreOnStartupBehavior {
|
|||
|
||||
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct WorkspaceSettingsContent {
|
||||
/// Scale by which to zoom the active pane.
|
||||
/// When set to 1.0, the active pane has the same size as others,
|
||||
/// but when set to a larger value, the active pane takes up more space.
|
||||
///
|
||||
/// Default: `1.0`
|
||||
pub active_pane_magnification: Option<f32>,
|
||||
/// Active pane styling settings.
|
||||
pub active_pane_modifiers: Option<ActivePanelModifiers>,
|
||||
// Direction to split horizontally.
|
||||
//
|
||||
// Default: "up"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue