Crates.io | tauri-plugin-trafficlights-positioner |
lib.rs | tauri-plugin-trafficlights-positioner |
version | 1.0.0 |
source | src |
created_at | 2024-08-02 20:43:34.551883 |
updated_at | 2024-08-02 20:43:34.551883 |
description | A Tauri v1 plugin to help setting the position of the window traffic lights on macOS. |
homepage | |
repository | https://github.com/itseeleeya/tauri-plugin-trafficlights-positioner/ |
max_upload_size | |
id | 1323682 |
size | 23,163 |
This plugin helps you set a custom inset for the window controls on macOS. Currently only for Tauri v1.*
This is done without any visible artifacts on resize.
fn main() {
tauri::Builder::default()
.setup(move |app| {
if let Some(window) = app.get_window("main") {
#[cfg(target_os = "macos")]
// NOTE: Make sure you only call this ONCE per window.
let _ = window.setup_traffic_lights_inset(LogicalPosition::new(20.0, 24.0));
};
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Cargo.toml:
[target.'cfg(target_os = "macos")'.dependencies]
tauri-plugin-trafficlights-positioner = { git = "https://github.com/ItsEeleeya/tauri-plugin-trafficlights-positioner/" }
If you need extra customization (especially for Windows) use clearlysid/tauri-plugin-decorum
Almost all credits for positioner.rs
goes to @haasal, @charrondev and Hoppscotch
This is also similar to how it is implemented in the Zed editor.
Original Tauri Issue: https://github.com/tauri-apps/tauri/issues/4789
(Gist) https://gist.github.com/charrondev/43150e940bd2771b1ea88256d491c7a9