fix(deps): update tauri monorepo (#1382)

* fix(deps): update tauri monorepo

* fix positioner

* Update lib.rs

* Update lib.rs

* fix build

* change file

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: amrbashir <amr.bashir2015@gmail.com>
This commit is contained in:
renovate[bot]
2024-05-30 06:49:05 +03:00
committed by GitHub
parent 0678af3a6c
commit 9013854f42
35 changed files with 278 additions and 212 deletions
+15 -5
View File
@@ -35,12 +35,22 @@ struct Tray(std::sync::Mutex<Option<(PhysicalPosition<f64>, PhysicalSize<f64>)>>
#[cfg(feature = "tray-icon")]
pub fn on_tray_event<R: Runtime>(app: &AppHandle<R>, event: &TrayIconEvent) {
let position = PhysicalPosition {
x: event.position.x,
y: event.position.y,
let (position, size) = {
match event {
TrayIconEvent::Click { rect, .. }
| TrayIconEvent::Enter { rect, .. }
| TrayIconEvent::Leave { rect, .. }
| TrayIconEvent::Move { rect, .. } => {
// tray-icon emits PhysicalSize so the scale factor should not matter.
let size = rect.size.to_physical(1.0);
let position = rect.position.to_physical(1.0);
(position, size)
}
_ => return,
}
};
// tray-icon emits PhysicalSize so the scale factor should not matter.
let size = event.icon_rect.size.to_physical(1.0);
app.state::<Tray>()
.0
.lock()