Merge remote-tracking branch 'origin/v1' into chore/merge-v1-into-v2

This commit is contained in:
FabianLars
2024-04-15 18:23:45 +02:00
65 changed files with 1075 additions and 371 deletions
+4 -6
View File
@@ -36,13 +36,11 @@ 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.x,
y: event.y,
};
let size = PhysicalSize {
width: event.icon_rect.right - event.icon_rect.left,
height: event.icon_rect.bottom - event.icon_rect.top,
x: event.position.x,
y: event.position.y,
};
// 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()