root: Fix Root use text size may override default text color. (#1576)

This commit is contained in:
Jason Lee 2025-11-12 19:05:30 +08:00 committed by GitHub
parent 8c2d4de435
commit 1074f78fb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -224,7 +224,7 @@ pub fn create_new_window_with_size<F, E>(
let view = crate_view_fn(window, cx); let view = crate_view_fn(window, cx);
let root = cx.new(|cx| StoryRoot::new(title.clone(), view, 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"); .expect("failed to open window");

View file

@ -405,9 +405,9 @@ impl Render for Root {
.on_action(cx.listener(Self::on_action_tab)) .on_action(cx.listener(Self::on_action_tab))
.on_action(cx.listener(Self::on_action_tab_prev)) .on_action(cx.listener(Self::on_action_tab_prev))
.font_family(".SystemUIFont") .font_family(".SystemUIFont")
.refine_style(&self.style)
.bg(cx.theme().background) .bg(cx.theme().background)
.text_color(cx.theme().foreground) .text_color(cx.theme().foreground)
.refine_style(&self.style)
.relative() .relative()
.size_full() .size_full()
.child(self.view.clone()) .child(self.view.clone())