From bc4e5732a09c3c6f5802781f7ff389901bcd47f0 Mon Sep 17 00:00:00 2001 From: Floyd Wang Date: Tue, 6 Aug 2024 11:51:39 +0800 Subject: [PATCH] Fix label text align not work (#111) image --- crates/ui/src/label.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ui/src/label.rs b/crates/ui/src/label.rs index 7868a091..59efe19e 100644 --- a/crates/ui/src/label.rs +++ b/crates/ui/src/label.rs @@ -3,7 +3,7 @@ use gpui::{ Styled, WindowContext, }; -use crate::theme::ActiveTheme; +use crate::{h_flex, theme::ActiveTheme}; #[derive(Default)] pub enum TextAlign { @@ -25,7 +25,7 @@ pub struct Label { impl Label { pub fn new(label: impl Into) -> Self { Self { - base: div().line_height(rems(1.25)), + base: h_flex().line_height(rems(1.25)), label: label.into(), multiple_lines: true, align: TextAlign::default(),