Replies: 1 comment
-
|
#911 (comment) pub fn set_style(&mut self, style: StyleResource) {
self.style = style;
fn notify_depth_first(node: Handle<UiNode>, ui: &UserInterface) {
if let Ok(node_ref) = ui.try_get_node(node) {
for child in node_ref.children.iter() {
notify_depth_first(*child, ui);
}
ui.send(node, WidgetMessage::Style(ui.style.clone()));
}
}
notify_depth_first(self.root_canvas, self);
}the Ui sends WidgetMessage::Style(style) => {
self.invalidate_visual();
self.background.update(style);
self.foreground.update(style);
self.style = Some(style.clone());
}but as shown, the method only updates Yet, widgets that carry TextMessage::FontSize(height) => {
if text_ref.font_size() != height {
text_ref.set_font_size(height.clone());
drop(text_ref);
self.invalidate_layout();
}
}which updates the text directly, this means per-category updates (World Viewer, Asset Browser etc.) are impossible as every text will be updated upon calling PR #914 addresses this by adding
so Then why not use
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue: #910
Pull Request: #911
Summary
This is to discuss the implementation of Editor font size settings.
Goals
SettingsWindowoption to configure Editor font size.Textwidgets into categories (World Viewer, Asset Browser, Inspector, etc.).Textwidgets by category so each area can have an independent font size.Implementation
Looking for suggestions and/or feedback, thanks.
Beta Was this translation helpful? Give feedback.
All reactions