|
|
|
@ -107,12 +107,12 @@ impl<R: Runtime> WindowExt for Window<R> {
|
|
|
|
|
},
|
|
|
|
|
#[cfg(feature = "system-tray")]
|
|
|
|
|
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;
|
|
|
|
|
// Choose y value based on the target OS
|
|
|
|
|
#[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")]
|
|
|
|
|
let y = if y < 0 { tray_y } else { y };
|
|
|
|
@ -135,13 +135,13 @@ impl<R: Runtime> WindowExt for Window<R> {
|
|
|
|
|
}
|
|
|
|
|
#[cfg(feature = "system-tray")]
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
let y = tray_y - window_size.height;
|
|
|
|
|
// Choose y value based on the target OS
|
|
|
|
|
#[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")]
|
|
|
|
|
let y = if y < 0 { tray_y } else { y };
|
|
|
|
@ -168,14 +168,14 @@ impl<R: Runtime> WindowExt for Window<R> {
|
|
|
|
|
}
|
|
|
|
|
#[cfg(feature = "system-tray")]
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
let x = tray_x + tray_width / 2 - window_size.width / 2;
|
|
|
|
|
let y = tray_y - window_size.height;
|
|
|
|
|
// Choose y value based on the target OS
|
|
|
|
|
#[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")]
|
|
|
|
|
let y = if y < 0 { tray_y } else { y };
|
|
|
|
|