pull/291/head
Xinyu Yang 2 years ago
parent 9e033cd89f
commit 6c400d02d8

@ -107,12 +107,12 @@ impl<R: Runtime> WindowExt for Window<R> {
}, },
#[cfg(feature = "system-tray")] #[cfg(feature = "system-tray")]
TrayLeft => { TrayLeft => {
if let (Some((tray_x, tray_y)), Some((_, tray_height))) = (tray_position, tray_size) if let (Some((tray_x, tray_y)), Some((_, _tray_height))) = (tray_position, tray_size)
{ {
let y = tray_y - window_size.height; let y = tray_y - window_size.height;
// Choose y value based on the target OS // Choose y value based on the target OS
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
let y = if y < 0 { tray_y + tray_height } else { y }; let y = if y < 0 { tray_y + _tray_height } else { y };
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
let y = if y < 0 { tray_y } else { y }; let y = if y < 0 { tray_y } else { y };
@ -135,13 +135,13 @@ impl<R: Runtime> WindowExt for Window<R> {
} }
#[cfg(feature = "system-tray")] #[cfg(feature = "system-tray")]
TrayRight => { TrayRight => {
if let (Some((tray_x, tray_y)), Some((tray_width, tray_height))) = if let (Some((tray_x, tray_y)), Some((tray_width, _tray_height))) =
(tray_position, tray_size) (tray_position, tray_size)
{ {
let y = tray_y - window_size.height; let y = tray_y - window_size.height;
// Choose y value based on the target OS // Choose y value based on the target OS
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
let y = if y < 0 { tray_y + tray_height } else { y }; let y = if y < 0 { tray_y + _tray_height } else { y };
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
let y = if y < 0 { tray_y } else { y }; let y = if y < 0 { tray_y } else { y };
@ -168,14 +168,14 @@ impl<R: Runtime> WindowExt for Window<R> {
} }
#[cfg(feature = "system-tray")] #[cfg(feature = "system-tray")]
TrayCenter => { TrayCenter => {
if let (Some((tray_x, tray_y)), Some((tray_width, tray_height))) = if let (Some((tray_x, tray_y)), Some((tray_width, _tray_height))) =
(tray_position, tray_size) (tray_position, tray_size)
{ {
let x = tray_x + tray_width / 2 - window_size.width / 2; let x = tray_x + tray_width / 2 - window_size.width / 2;
let y = tray_y - window_size.height; let y = tray_y - window_size.height;
// Choose y value based on the target OS // Choose y value based on the target OS
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
let y = if y < 0 { tray_y + tray_height } else { y }; let y = if y < 0 { tray_y + _tray_height } else { y };
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
let y = if y < 0 { tray_y } else { y }; let y = if y < 0 { tray_y } else { y };

Loading…
Cancel
Save