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

Is there a way to override the theme? #170

Closed
CrendKing opened this issue Mar 26, 2024 · 1 comment · Fixed by #194
Closed

Is there a way to override the theme? #170

CrendKing opened this issue Mar 26, 2024 · 1 comment · Fixed by #194

Comments

@CrendKing
Copy link

When I launch the main Tauri app, I could override the theme of webview window with my value, e.g.

let mut tauri_context = tauri::tauri_build_context!();
tauri_context.config_mut().app.windows[0].theme = Some(tauri::Theme::Light);

However, currently this does not apply to the context menu generate with MenuBuilder or the Javascript API. Any way to bridge the discrepancy? Thanks for the great work!

@CrendKing CrendKing changed the title Is there a way to override the theme on Windows? Is there a way to override the theme? Mar 26, 2024
@CrendKing
Copy link
Author

Looks like on Windows, muda use TrackPopupMenu to do the context menu. According to https://stackoverflow.com/questions/76573219/setting-theme-for-legacy-controls, it seems there is no official way to just override the theme for that menu.

I wonder if switching to the new menu API (maybe #167) would give us any option?

amrbashir added a commit that referenced this issue May 14, 2024
amrbashir added a commit that referenced this issue May 14, 2024
* feat(windows): add theme support

closes #170

* clippy
amrbashir added a commit to tauri-apps/tauri that referenced this issue May 20, 2024
lucasfernog added a commit to tauri-apps/tauri that referenced this issue May 24, 2024
* fix(Windows): sync menubar theme with the window theme

ref: tauri-apps/muda#170

* fix moc runtime

* muda 0.13.4

* missing change file

---------

Co-authored-by: Lucas Nogueira <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant