label: Fix typo (#722)

This commit is contained in:
Floyd Wang 2025-03-19 14:15:49 +08:00 committed by GitHub
parent 88325ea14b
commit 49e8b06ccb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,7 +11,7 @@ pub struct Label {
base: Div, base: Div,
label: SharedString, label: SharedString,
chars_count: usize, chars_count: usize,
marked: bool, masked: bool,
} }
impl Label { impl Label {
@ -22,12 +22,12 @@ impl Label {
base: div().line_height(rems(1.25)), base: div().line_height(rems(1.25)),
label, label,
chars_count, chars_count,
marked: false, masked: false,
} }
} }
pub fn masked(mut self, masked: bool) -> Self { pub fn masked(mut self, masked: bool) -> Self {
self.marked = masked; self.masked = masked;
self self
} }
} }
@ -40,7 +40,7 @@ impl Styled for Label {
impl RenderOnce for Label { impl RenderOnce for Label {
fn render(self, _: &mut Window, cx: &mut App) -> impl IntoElement { fn render(self, _: &mut Window, cx: &mut App) -> impl IntoElement {
let text = if self.marked { let text = if self.masked {
SharedString::from(MASKED.repeat(self.chars_count)) SharedString::from(MASKED.repeat(self.chars_count))
} else { } else {
self.label self.label