From 1074f78fb0a367c0535f46bfe0790d06876dbc71 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Wed, 12 Nov 2025 19:05:30 +0800 Subject: [PATCH] root: Fix Root use text size may override default text color. (#1576) --- crates/story/src/lib.rs | 2 +- crates/ui/src/root.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/story/src/lib.rs b/crates/story/src/lib.rs index bc69e02a..79843af1 100644 --- a/crates/story/src/lib.rs +++ b/crates/story/src/lib.rs @@ -224,7 +224,7 @@ pub fn create_new_window_with_size( let view = crate_view_fn(window, cx); let root = cx.new(|cx| StoryRoot::new(title.clone(), view, window, cx)); - cx.new(|cx| Root::new(root.into(), window, cx)) + cx.new(|cx| Root::new(root.into(), window, cx).text_base()) }) .expect("failed to open window"); diff --git a/crates/ui/src/root.rs b/crates/ui/src/root.rs index 3e97c87b..9fdd05e3 100644 --- a/crates/ui/src/root.rs +++ b/crates/ui/src/root.rs @@ -405,9 +405,9 @@ impl Render for Root { .on_action(cx.listener(Self::on_action_tab)) .on_action(cx.listener(Self::on_action_tab_prev)) .font_family(".SystemUIFont") + .refine_style(&self.style) .bg(cx.theme().background) .text_color(cx.theme().foreground) - .refine_style(&self.style) .relative() .size_full() .child(self.view.clone())