Fix Checkbox, Radio label color. (#200)

This commit is contained in:
Jason Lee 2024-09-02 00:24:57 +08:00 committed by GitHub
parent 1f0e52da50
commit a049f606c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 4 deletions

View file

@ -11,7 +11,7 @@ use ui::{
h_flex,
input::{InputEvent, OtpInput, TextInput},
prelude::FluentBuilder as _,
theme::{ActiveTheme, Colorize, Theme},
theme::{Colorize, Theme},
v_flex, FocusableCycle, IconName, Sizable,
};

View file

@ -113,14 +113,13 @@ impl RenderOnce for Checkbox {
)
.map(|this| {
if let Some(label) = self.label {
this.child(
this.text_color(cx.theme().foreground).child(
div()
.w_full()
.overflow_hidden()
.line_height(relative(1.))
.child(label),
)
.text_color(color)
} else {
this
}

View file

@ -63,7 +63,7 @@ impl RenderOnce for Radio {
.id(self.id)
.gap_x_2()
.cursor(CursorStyle::PointingHand)
.text_color(color)
.text_color(cx.theme().foreground)
.items_start()
.child(
div()