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

bug: using set_theme is causing "low resolution" on some modules #75

Open
CtByte opened this issue Nov 20, 2024 · 4 comments
Open

bug: using set_theme is causing "low resolution" on some modules #75

CtByte opened this issue Nov 20, 2024 · 4 comments

Comments

@CtByte
Copy link

CtByte commented Nov 20, 2024

Hi, thank you for this project!

I've noticed that after using the set_theme function, some of the modules become "low resolution".

Before
image

After
image

I've created a project to demo this.

Would you please let me know if there is a way to fix this?

> rustup --version
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.82.0 (f6e511eec 2024-10-15)`
@Stonks3141
Copy link
Member

Hi, thanks for reporting this issue! As far as I can tell, this is because catppuccin-egui defines a border color while the default theme does not, and the border isn't antialiased for some reason. This also came up in #23. Would you mind testing it with the changes in #76 applied (the no-border branch) to see if the bug persists?

@CtByte
Copy link
Author

CtByte commented Dec 3, 2024

@Stonks3141 Thanks for looking into this, I built the no-border branch and used the todo example to check against my demo project.

The result proves that removing the bg_stroke is the right thing to do. It is seemingly an anti-alias issue in egui

image


I don't know if this helps, but I did a small test and it only seems to be an issue on the inactive bg_stoke.

It could also be that the widget should shrink in egui when bg_stroke is added, as it seems to be cut off. 🤷

        catppuccin_egui::set_theme(ctx, catppuccin_egui::LATTE);

        ctx.style_mut(|style| {
            let rounding = Rounding::same(10.0);

            style.visuals.widgets.noninteractive.rounding = rounding;
            style.visuals.widgets.inactive.rounding = rounding;
            style.visuals.widgets.hovered.rounding = rounding;
            style.visuals.widgets.active.rounding = rounding;
            style.visuals.widgets.open.rounding = rounding;

            style.visuals.widgets.inactive.bg_stroke.color = Color32::TRANSPARENT; // <--
        });

image

@skoove
Copy link

skoove commented Feb 10, 2025

@CtByte 's solution of setting ctx.style_mut.visuals.widgets.inactive.bg_stroke.color = Color32::TRANSPARENT worked for me too!

Image

@CtByte
Copy link
Author

CtByte commented Feb 15, 2025

@Stonks3141 I could not really test this properly but there seem to be a change in eframe 0.31 that draws the stroke inside instead of outside.

I think this might just fix this issue. 🤞

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

No branches or pull requests

3 participants