Fix Label text_align again.
This commit is contained in:
parent
ed132ad55e
commit
4c81977639
2 changed files with 3 additions and 3 deletions
|
|
@ -52,9 +52,8 @@ impl Render for CheckboxStory {
|
|||
.child(
|
||||
section("Label", cx)
|
||||
.child(
|
||||
h_flex()
|
||||
v_flex()
|
||||
.w_full()
|
||||
.justify_between()
|
||||
.gap_4()
|
||||
.child(Label::new("Text align left"))
|
||||
.child(Label::new("Text align center").text_center())
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use gpui::{
|
|||
Styled, WindowContext,
|
||||
};
|
||||
|
||||
use crate::theme::ActiveTheme;
|
||||
use crate::{theme::ActiveTheme, StyledExt};
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum TextAlign {
|
||||
|
|
@ -88,6 +88,7 @@ impl RenderOnce for Label {
|
|||
|
||||
div().text_color(cx.theme().foreground).child(
|
||||
self.base
|
||||
.h_flex()
|
||||
.map(|this| match self.align {
|
||||
TextAlign::Left => this.justify_start(),
|
||||
TextAlign::Center => this.justify_center(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue