Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Seperate pane and panel styling

Mikayla Maki685e8d70072f
diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs
index b1c9e9c2153..21c01150a85 100644
--- a/crates/theme/src/theme.rs
+++ b/crates/theme/src/theme.rs
@@ -89,7 +89,8 @@ pub struct Workspace {
pub breadcrumbs: Interactive<ContainedText>,
pub disconnected_overlay: ContainedText,
pub modal: ContainerStyle,
- pub zoomed_foreground: ContainerStyle,
+ pub zoomed_panel_foreground: ContainerStyle,
+ pub zoomed_pane_foreground: ContainerStyle,
pub zoomed_background: ContainerStyle,
pub notification: ContainerStyle,
pub notifications: Notifications,
diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs
index 23d3d6f3781..8dca08ec810 100644
--- a/crates/workspace/src/pane.rs
+++ b/crates/workspace/src/pane.rs
@@ -2,7 +2,7 @@ mod dragged_item_receiver;
use super::{ItemHandle, SplitDirection};
use crate::{
- item::WeakItemHandle, toolbar::Toolbar, AutosaveSetting, Item, NewFile, NewSearch, NewTerminal,
+ item::WeakItemHandle, toolbar::Toolbar, AutosaveSetting, Item, NewFile, NewSearch,
ToggleZoom, Workspace, WorkspaceSettings, NewCenterTerminal,
};
use anyhow::Result;
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index 9285e911ef1..0aefe455ac9 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -3270,37 +3270,42 @@ impl View for Workspace {
enum ZoomBackground {}
let zoomed = zoomed.upgrade(cx)?;
- let mut background_style =
- theme.workspace.zoomed_background;
+ let mut foreground_style;
match self.zoomed_position {
Some(DockPosition::Left) => {
- background_style.padding.left = 0.;
- background_style.padding.top = 0.;
- background_style.padding.bottom = 0.;
- background_style.padding.right *= 1.;
+ foreground_style =
+ theme.workspace.zoomed_panel_foreground;
+ foreground_style.margin.left = 0.;
+ foreground_style.margin.top = 0.;
+ foreground_style.margin.bottom = 0.;
}
Some(DockPosition::Right) => {
- background_style.padding.right = 0.;
- background_style.padding.top = 0.;
- background_style.padding.bottom = 0.;
- background_style.padding.left *= 1.;
+ foreground_style =
+ theme.workspace.zoomed_panel_foreground;
+ foreground_style.margin.right = 0.;
+ foreground_style.margin.top = 0.;
+ foreground_style.margin.bottom = 0.;
}
Some(DockPosition::Bottom) => {
- background_style.padding.left = 0.;
- background_style.padding.right = 0.;
- background_style.padding.bottom = 0.;
- background_style.padding.top *= 1.;
+ foreground_style =
+ theme.workspace.zoomed_panel_foreground;
+ foreground_style.margin.left = 0.;
+ foreground_style.margin.right = 0.;
+ foreground_style.margin.bottom = 0.;
+ }
+ None => {
+ foreground_style =
+ theme.workspace.zoomed_pane_foreground;
}
- None => {}
}
Some(
ChildView::new(&zoomed, cx)
.contained()
- .with_style(theme.workspace.zoomed_foreground)
+ .with_style(foreground_style)
.aligned()
.contained()
- .with_style(background_style)
+ .with_style(theme.workspace.zoomed_background)
.mouse::<ZoomBackground>(0)
.capture_all()
.on_down(
diff --git a/styles/src/styleTree/workspace.ts b/styles/src/styleTree/workspace.ts
index 737d225784a..cf5234aa004 100644
--- a/styles/src/styleTree/workspace.ts
+++ b/styles/src/styleTree/workspace.ts
@@ -119,14 +119,18 @@ export default function workspace(colorScheme: ColorScheme) {
cursor: "Arrow",
},
zoomedBackground: {
- padding: 10,
cursor: "Arrow",
- background: withOpacity(background(colorScheme.lowest), 0.5)
+ background: withOpacity(background(colorScheme.lowest), 0.85)
},
- zoomedForeground: {
+ zoomedPaneForeground: {
+ margin: 10,
shadow: colorScheme.modalShadow,
border: border(colorScheme.highest, { overlay: true }),
},
+ zoomedPanelForeground: {
+ margin: 18,
+ border: border(colorScheme.highest, { overlay: true }),
+ },
dock: {
left: {
border: border(layer, { right: true }),