Throw a little between filename and modified icon
Max Brunsfeld
created 4 years ago
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.
Change summary
gpui/src/elements/container.rs | 5 +++++
zed/src/workspace/pane.rs | 12 ++++--------
2 files changed, 9 insertions(+), 8 deletions(-)
Detailed changes
@@ -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,
@@ -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(),