From 187eb95b1336a082e1a92852af9cf4c3455d9498 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 7 Apr 2021 15:39:09 -0700 Subject: [PATCH] Throw a little between filename and modified icon We probably need a primitive to right-align an element within its parent, but I don't have strong opinions about how that should be designed, so I'm just adding this as a temporary measure so that the tabs won't look too ugly in the meantime. --- gpui/src/elements/container.rs | 5 +++++ zed/src/workspace/pane.rs | 12 ++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gpui/src/elements/container.rs b/gpui/src/elements/container.rs index 13a80848c410679305ada2a0429118ff8f7ac1ef..83b3e820e3d358a461ca7b50bbf1c5ae97beaa30 100644 --- a/gpui/src/elements/container.rs +++ b/gpui/src/elements/container.rs @@ -36,6 +36,11 @@ impl Container { self } + pub fn with_margin_left(mut self, margin: f32) -> Self { + self.margin.left = margin; + self + } + pub fn with_uniform_padding(mut self, padding: f32) -> Self { self.padding = Padding { top: padding, diff --git a/zed/src/workspace/pane.rs b/zed/src/workspace/pane.rs index 15c8195d31c4f55909f35e98df660f59e6942762..845fa0c4a71135968838b789e8ea821f3e4ad8cf 100644 --- a/zed/src/workspace/pane.rs +++ b/zed/src/workspace/pane.rs @@ -196,16 +196,11 @@ impl Pane { Align::new( Flex::row() .with_child( - Expanded::new( - 1.0, - Label::new(title, settings.ui_font_family, settings.ui_font_size) - .boxed(), - ) - .boxed(), + Label::new(title, settings.ui_font_family, settings.ui_font_size) + .boxed(), ) .with_child( - Expanded::new( - 1.0, + Container::new( LineBox::new( settings.ui_font_family, settings.ui_font_size, @@ -217,6 +212,7 @@ impl Pane { ) .boxed(), ) + .with_margin_left(20.) .boxed(), ) .boxed(),