From a049f606c0e94d1c7ff504c520851a4da697d590 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 2 Sep 2024 00:24:57 +0800 Subject: [PATCH] Fix Checkbox, Radio label color. (#200) --- crates/story/src/input_story.rs | 2 +- crates/ui/src/checkbox.rs | 3 +-- crates/ui/src/radio.rs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/story/src/input_story.rs b/crates/story/src/input_story.rs index 2501ab9a..90970614 100644 --- a/crates/story/src/input_story.rs +++ b/crates/story/src/input_story.rs @@ -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, }; diff --git a/crates/ui/src/checkbox.rs b/crates/ui/src/checkbox.rs index b4953931..fb5665ae 100644 --- a/crates/ui/src/checkbox.rs +++ b/crates/ui/src/checkbox.rs @@ -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 } diff --git a/crates/ui/src/radio.rs b/crates/ui/src/radio.rs index 9f55c21a..621825d8 100644 --- a/crates/ui/src/radio.rs +++ b/crates/ui/src/radio.rs @@ -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()