mirror of
https://github.com/luminous-devs/lume.git
synced 2024-09-19 11:43:30 +00:00
added macos checker for traffic lights function
This commit is contained in:
parent
beabda68b1
commit
54dd097e42
@ -17,7 +17,8 @@ fn main() {
|
|||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.setup(|app| {
|
.setup(|app| {
|
||||||
let main_window = app.get_window("main").unwrap();
|
let main_window = app.get_window("main").unwrap();
|
||||||
// set inset for traffic lights
|
// set inset for traffic lights (macos)
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
main_window.position_traffic_lights(8.0, 20.0);
|
main_window.position_traffic_lights(8.0, 20.0);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -36,11 +37,12 @@ fn main() {
|
|||||||
.build(),
|
.build(),
|
||||||
)
|
)
|
||||||
.on_window_event(|e| {
|
.on_window_event(|e| {
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
let apply_offset = || {
|
let apply_offset = || {
|
||||||
let win = e.window();
|
let win = e.window();
|
||||||
win.position_traffic_lights(8.0, 20.0);
|
win.position_traffic_lights(8.0, 20.0);
|
||||||
};
|
};
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
match e.event() {
|
match e.event() {
|
||||||
WindowEvent::Resized(..) => apply_offset(),
|
WindowEvent::Resized(..) => apply_offset(),
|
||||||
WindowEvent::ThemeChanged(..) => apply_offset(),
|
WindowEvent::ThemeChanged(..) => apply_offset(),
|
||||||
|
Loading…
Reference in New Issue
Block a user