From d6519ad2809ea2c562c9b9b0aaa935d588c08183 Mon Sep 17 00:00:00 2001 From: K Simmons Date: Thu, 21 Jul 2022 14:56:17 -0700 Subject: [PATCH] Minor naming improvements and revert empty pane background color change --- crates/theme/src/theme.rs | 8 ++++---- crates/workspace/src/drag_and_drop.rs | 0 crates/workspace/src/pane.rs | 18 ++++++++--------- styles/src/styleTree/workspace.ts | 28 +++++++++++++-------------- 4 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 crates/workspace/src/drag_and_drop.rs diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index 8c6a696d081b1b4066f9340a0e570b883605daaf..540c5bfd6c80999104475e43b18f9d504eb6bc65 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -38,10 +38,10 @@ pub struct Theme { pub struct Workspace { pub background: Color, pub titlebar: Titlebar, - pub focused_active_tab: Tab, - pub focused_inactive_tab: Tab, - pub unfocused_active_tab: Tab, - pub unfocused_inactive_tab: Tab, + pub active_pane_active_tab: Tab, + pub active_pane_inactive_tab: Tab, + pub inactive_pane_active_tab: Tab, + pub inactive_pane_inactive_tab: Tab, pub pane_button: Interactive, pub pane_divider: Border, pub leader_border_opacity: f32, diff --git a/crates/workspace/src/drag_and_drop.rs b/crates/workspace/src/drag_and_drop.rs new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index 41869c2c24da0fbe704aa4a1f27540d0454273e0..c384748c3caeb227f3abe034b213de8ce07f3b12 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -880,10 +880,10 @@ impl Pane { row.add_child({ let mut tab_style = match (is_pane_active, is_tab_active) { - (true, true) => theme.workspace.focused_active_tab.clone(), - (true, false) => theme.workspace.focused_inactive_tab.clone(), - (false, true) => theme.workspace.unfocused_active_tab.clone(), - (false, false) => theme.workspace.unfocused_inactive_tab.clone(), + (true, true) => theme.workspace.active_pane_active_tab.clone(), + (true, false) => theme.workspace.active_pane_inactive_tab.clone(), + (false, true) => theme.workspace.inactive_pane_active_tab.clone(), + (false, false) => theme.workspace.inactive_pane_inactive_tab.clone(), }; let title = item.tab_content(detail, &tab_style, cx); @@ -997,16 +997,16 @@ impl Pane { } let filler_style = if is_pane_active { - &theme.workspace.focused_inactive_tab + &theme.workspace.active_pane_inactive_tab } else { - &theme.workspace.unfocused_inactive_tab + &theme.workspace.inactive_pane_inactive_tab }; row.add_child( Empty::new() .contained() .with_style(filler_style.container) - .with_border(theme.workspace.focused_active_tab.container.border) + .with_border(theme.workspace.active_pane_active_tab.container.border) .flex(0., true) .named("filler"), ); @@ -1115,7 +1115,7 @@ impl View for Pane { cx.global::() .theme .workspace - .focused_active_tab + .active_pane_active_tab .height, ) .boxed() @@ -1130,7 +1130,7 @@ impl View for Pane { MouseEventHandler::new::(0, cx, |_, _| { Empty::new() .contained() - .with_background_color(theme.editor.background) + .with_background_color(theme.workspace.background) .boxed() }) .on_down(MouseButton::Left, |_, cx| { diff --git a/styles/src/styleTree/workspace.ts b/styles/src/styleTree/workspace.ts index 4e88aded04ef38175b7c907ee7a5372e1e7fb18b..c86dce72262112c5f5b49301d2ed481c01036604 100644 --- a/styles/src/styleTree/workspace.ts +++ b/styles/src/styleTree/workspace.ts @@ -14,7 +14,7 @@ export function workspaceBackground(theme: Theme) { } export default function workspace(theme: Theme) { - const focusedInactiveTab = { + const activePaneInactiveTab = { height: 32, background: workspaceBackground(theme), iconClose: iconColor(theme, "muted"), @@ -39,24 +39,24 @@ export default function workspace(theme: Theme) { } }; - const focusedActiveTab = { - ...focusedInactiveTab, + const activePaneActiveTab = { + ...activePaneInactiveTab, background: backgroundColor(theme, 500), text: text(theme, "sans", "active", { size: "sm" }), border: { - ...focusedInactiveTab.border, + ...activePaneInactiveTab.border, bottom: false, }, }; - const unfocusedInactiveTab = { - ...focusedInactiveTab, + const inactivePaneInactiveTab = { + ...activePaneInactiveTab, background: backgroundColor(theme, 100), text: text(theme, "sans", "placeholder", { size: "sm" }), }; - const unfocusedActiveTab = { - ...focusedInactiveTab, + const inactivePaneActiveTab = { + ...activePaneInactiveTab, text: text(theme, "sans", "placeholder", { size: "sm" }), } @@ -74,17 +74,17 @@ export default function workspace(theme: Theme) { }, leaderBorderOpacity: 0.7, leaderBorderWidth: 2.0, - focusedActiveTab, - focusedInactiveTab, - unfocusedActiveTab, - unfocusedInactiveTab, + activePaneActiveTab, + activePaneInactiveTab, + inactivePaneActiveTab, + inactivePaneInactiveTab, paneButton: { color: iconColor(theme, "secondary"), border: { - ...focusedActiveTab.border, + ...activePaneActiveTab.border, }, iconWidth: 12, - buttonWidth: focusedActiveTab.height, + buttonWidth: activePaneActiveTab.height, hover: { color: iconColor(theme, "active"), background: backgroundColor(theme, 300),