mirror of
https://github.com/tauri-apps/tao.git
synced 2026-01-31 00:35:16 +01:00
fix: the system theme obtained is always light (#1091)
* fix(macos): the system theme obtained is always light (https://github.com/tauri-apps/tauri/issues/12894) Signed-off-by: The1111mp <The1111mp@outlook.com> * add change file --------- Signed-off-by: The1111mp <The1111mp@outlook.com> Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
5
.changes/fix-macos-theme.md
Normal file
5
.changes/fix-macos-theme.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tao": patch
|
||||
---
|
||||
|
||||
Fix `Window::theme()` always returning `Theme::Light` and `WindowEvent::ThemeChanged()` not delivered on macOS.
|
||||
@@ -332,7 +332,7 @@ pub(super) fn get_ns_theme() -> Theme {
|
||||
let app_class = class!(NSApplication);
|
||||
let app: id = msg_send![app_class, sharedApplication];
|
||||
let has_theme: bool = msg_send![app, respondsToSelector: sel!(effectiveAppearance)];
|
||||
if has_theme {
|
||||
if !has_theme {
|
||||
return Theme::Light;
|
||||
}
|
||||
let appearance: id = msg_send![app, effectiveAppearance];
|
||||
|
||||
Reference in New Issue
Block a user