mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-29 21:51:59 +02:00
Started on general window layout
This commit is contained in:
@@ -3,11 +3,36 @@
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[macro_use]
|
||||
extern crate objc;
|
||||
|
||||
mod commands;
|
||||
mod runtime;
|
||||
mod window_ext;
|
||||
|
||||
use tauri::{Manager, WindowEvent};
|
||||
use window_ext::WindowExt;
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.setup(|app| {
|
||||
let win = app.get_window("main").unwrap();
|
||||
win.position_traffic_lights();
|
||||
Ok(())
|
||||
})
|
||||
.on_window_event(|e| {
|
||||
let apply_offset = || {
|
||||
let win = e.window();
|
||||
win.position_traffic_lights();
|
||||
};
|
||||
|
||||
match e.event() {
|
||||
WindowEvent::Resized(..) => apply_offset(),
|
||||
WindowEvent::ThemeChanged(..) => apply_offset(),
|
||||
_ => {}
|
||||
}
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
commands::send_request,
|
||||
commands::greet
|
||||
|
||||
Reference in New Issue
Block a user