From 59931a472bab7cacfc7ff25e5b3ac99302a26981 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 7 Sep 2021 12:52:10 -0600 Subject: [PATCH] Style titlebar via theme and give it a bottom border Co-Authored-By: Max Brunsfeld --- zed/assets/themes/_base.toml | 3 +++ zed/src/theme.rs | 1 + zed/src/workspace.rs | 10 +++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/zed/assets/themes/_base.toml b/zed/assets/themes/_base.toml index bdb79c5a97..115f8399d4 100644 --- a/zed/assets/themes/_base.toml +++ b/zed/assets/themes/_base.toml @@ -4,6 +4,9 @@ base = { family = "Inconsolata", size = 14 } [workspace] background = "$surface.0" +[workspace.titlebar] +border = { width = 1, bottom = true, color = "$surface.1" } + [workspace.tab] text = "$text.2" padding = { left = 10, right = 10 } diff --git a/zed/src/theme.rs b/zed/src/theme.rs index cd65db1e62..c9943e2a4b 100644 --- a/zed/src/theme.rs +++ b/zed/src/theme.rs @@ -33,6 +33,7 @@ pub struct SyntaxTheme { #[derive(Deserialize)] pub struct Workspace { pub background: Color, + pub titlebar: ContainerStyle, pub tab: Tab, pub active_tab: Tab, pub sidebar: Sidebar, diff --git a/zed/src/workspace.rs b/zed/src/workspace.rs index 1b7b9226d0..4977cf4265 100644 --- a/zed/src/workspace.rs +++ b/zed/src/workspace.rs @@ -952,9 +952,13 @@ impl View for Workspace { Container::new( Flex::column() .with_child( - ConstrainedBox::new(Empty::new().boxed()) - .with_height(32.) - .named("titlebar"), + ConstrainedBox::new( + Container::new(Empty::new().boxed()) + .with_style(&settings.theme.workspace.titlebar) + .boxed(), + ) + .with_height(32.) + .named("titlebar"), ) .with_child( Expanded::new(