Skip to content

Commit

Permalink
⚡ Make the app position at the center
Browse files Browse the repository at this point in the history
  • Loading branch information
katungi committed Jun 25, 2024
1 parent 1e5ca39 commit a47bd17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use window_vibrancy::{apply_vibrancy, NSVisualEffectMaterial};
windows_subsystem = "windows"
)]
#[tauri::command]

fn on_button_clicked() -> String {
let start = SystemTime::now();
let since_the_epoch = start
Expand Down Expand Up @@ -38,7 +39,7 @@ fn main() {
..
} => {
let window = app.get_window("main").unwrap();
let _ = window.move_window(Position::TrayCenter);
let _ = window.move_window(Position::Center);
if window.is_visible().unwrap() {
window.hide().unwrap();
} else {
Expand All @@ -59,7 +60,6 @@ fn main() {
})
.setup(|app| {
let window = app.get_window("main").unwrap();

#[cfg(target_os = "macos")]
apply_vibrancy(&window, NSVisualEffectMaterial::HudWindow, None, None)
.expect("Unsupported platform! 'apply_vibrancy' is only supported on macOS");
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
"title": "Pasta",
"width": 380,
"height": 600,
"decorations": false
"decorations": false,
"visible": false
}
],
"systemTray": {
Expand Down

0 comments on commit a47bd17

Please sign in to comment.