Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After settings_ui() was recently changed, it seems that visuals_mut() cannot be set. #4312

Closed
rustbasic opened this issue Apr 2, 2024 · 2 comments
Labels
bug Something is broken

Comments

@rustbasic
Copy link
Contributor

rustbasic commented Apr 2, 2024

After settings_ui() was recently changed, it seems that visuals_mut() cannot be set.

I haven't looked into it in detail yet.

    ui.visuals_mut().widgets.hovered.fg_stroke.color = hovered_color;
    ui.visuals_mut().widgets.active.fg_stroke.color = active_color;
    ui.visuals_mut().text_cursor.on_duration = 1.0;
    ui.visuals_mut().text_cursor.off_duration = 0.3;
@rustbasic rustbasic added the bug Something is broken label Apr 2, 2024
@rustbasic
Copy link
Contributor Author

rustbasic commented Apr 3, 2024

@emilk

What is certain is that until a few days ago, when I applied the following to change the scrollbar color of ScrollArea, it worked fine, but now it does not work.

Changing the value only once will reset it.
If you always change a value within the UI, the changed value will be retained.

    let hovered_color = egui::Color32::LIGHT_RED;
    let active_color = egui::Color32::LIGHT_BLUE;

    ui.visuals_mut().widgets.hovered.fg_stroke.color = hovered_color;
    ui.visuals_mut().widgets.active.fg_stroke.color = active_color;

This is expected to be a symptom caused by converting dark() and lignt() of egui/src/style.rs to default values.

It seems that items unrelated to dark() and light() should be separated and maintain their values.

Could it be because of this?

Or maybe it's for some other reason?

@rustbasic
Copy link
Contributor Author

I haven't verified that #4744 solves the issue, but it seems likely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant