Skip to content

gitbutlerapp/tauri-plugin-trafficlights-positioner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tauri Plugin Traffic Lights Positioner

This plugin helps you set a custom inset for the window controls on macOS. Currently only for Tauri v2.*

This is done without any visible artifacts on resize.

🧑‍🔧 Get the plugin

There is a crate on crates.io by this name, however, that is the (Tauri v1) version from ItsEeleeya.

Use git to get the latest v2 branch version from this repository.

[target.'cfg(target_os = "macos")'.dependencies]
tauri-plugin-trafficlights-positioner = { git = "https://github.com/gitbutlerapp/tauri-plugin-trafficlights-positioner?branch=v2" }

🏗️ Usage

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");
}

Note

If you need extra customization (especially for Windows) use clearlysid/tauri-plugin-decorum

🙏 Credits

Almost all credits for positioner.rs goes to @haasal, @charrondev, Hoppscotch and @ItsEeleeya.

This is also similar to how it is implemented in the Zed editor.
Original Tauri Issue: tauri-apps/tauri#4789

📝 License

MIT

About

Helps insetting the window traffic lights on macOS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 83.3%
  • HTML 16.7%