You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Changing at least some style members in eframe::run_native()'s app_creator callback works fine under Linux, but seems to have no effect in Windows. Repro code with workaround below.
To Reproduce
Steps to reproduce the behavior:
Set override_text_color or text_styles's font_id.sizes in eframe::run_native()'s app_creator callback.
Run on Linux
See correct colors and sizes
Run on Windows
See incorrect colors and sizes
Add workaround shown below
Run on Windows
See correct colors and sizes
Expected behavior
See the style changes on Windows.
Desktop (please complete the following information):
OS: Ubuntu 22.04 and Windows 11 Pro
egui / eframe: 0.31.0
Additional context
implLogViewerApp{
...
pubfnrun(self) -> eframe::Result{let native_options = eframe::NativeOptions{
...};
eframe::run_native("LogViewer",
native_options,Box::new(|cc| {setup_custom_fonts(&cc.egui_ctx);
cc.egui_ctx.style_mut(|style| {// This doesn't work on Windows. For example, override_text_color is None in update().
style.visuals = Visuals{override_text_color:Some(TEXT_COLOR),window_fill:Color32::WHITE,panel_fill:Color32::WHITE,
..Visuals::light()};for(_, font_id)in&mut style.text_styles{
font_id.size = 16.0;}});Ok(Box::new(self))}),)}}impl eframe::AppforLogViewerApp{fnupdate(&mutself,ctx:&Context,frame:&mut eframe::Frame){
ctx.style_mut(|style| {// Workaround for the above code not working on Windows
style.visuals = Visuals{override_text_color:Some(TEXT_COLOR),window_fill:Color32::WHITE,panel_fill:Color32::WHITE,
..Visuals::light()};for(_, font_id)in&mut style.text_styles{
font_id.size = 16.0;}});self.0.update(ctx, frame);}}
The text was updated successfully, but these errors were encountered:
Describe the bug
Changing at least some
style
members ineframe::run_native()
'sapp_creator
callback works fine under Linux, but seems to have no effect in Windows. Repro code with workaround below.To Reproduce
Steps to reproduce the behavior:
override_text_color
ortext_styles
'sfont_id.size
s ineframe::run_native()
'sapp_creator
callback.Expected behavior
See the style changes on Windows.
Desktop (please complete the following information):
0.31.0
Additional context
The text was updated successfully, but these errors were encountered: