Cannot customize window color on macos(m1,14.5 (23F79)) #12315
Replies: 2 comments
-
The first window without a |
Beta Was this translation helpful? Give feedback.
0 replies
-
#[cfg(target_os = "macos")]
{
use cocoa::appkit::{NSColor, NSWindow};
use cocoa::base::{id, nil};
if let Some(window) = app.get_webview_window("main") {
let ns_window = window.ns_window().unwrap() as id;
unsafe {
let bg_color = NSColor::colorWithRed_green_blue_alpha_(
nil,
29.0 / 255.0, // R: 0.1137
28.0 / 255.0, // G: 0.1098
44.0 / 255.0, // B: 0.1725
1.0, // Alpha: 1.0
);
println!("Window with label 'main' found.");
ns_window.setBackgroundColor_(bg_color);
}
} else {
println!("Window with label 'main' not found.");
}
} I found this Windows and set the color, but it doesn't work |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://tauri.app/learn/window-customization/#macos-transparent-titlebar-with-custom-window-background-color
Beta Was this translation helpful? Give feedback.
All reactions