From 0068b6bd9dc12ba0aed2c20ce1403131dfcd3733 Mon Sep 17 00:00:00 2001 From: CJ Pais Date: Thu, 7 Aug 2025 17:10:18 -0700 Subject: [PATCH] different bottom and top overlay offsets --- src-tauri/src/overlay.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/overlay.rs b/src-tauri/src/overlay.rs index f875a72..f528c6a 100644 --- a/src-tauri/src/overlay.rs +++ b/src-tauri/src/overlay.rs @@ -5,7 +5,8 @@ use tauri::{AppHandle, Emitter, Manager, WebviewWindowBuilder}; const OVERLAY_WIDTH: f64 = 172.0; const OVERLAY_HEIGHT: f64 = 36.0; -const OVERLAY_OFFSET: f64 = 46.0; +const OVERLAY_TOP_OFFSET: f64 = 46.0; +const OVERLAY_BOTTOM_OFFSET: f64 = 15.0; fn calculate_overlay_position(app_handle: &AppHandle) -> Option<(f64, f64)> { if let Ok(monitors) = app_handle.primary_monitor() { @@ -21,9 +22,10 @@ fn calculate_overlay_position(app_handle: &AppHandle) -> Option<(f64, f64)> { let x = work_area_x + (work_area_width - OVERLAY_WIDTH) / 2.0; let y = match settings.overlay_position { - OverlayPosition::Top => work_area_y + OVERLAY_OFFSET, + OverlayPosition::Top => work_area_y + OVERLAY_TOP_OFFSET, OverlayPosition::Bottom | OverlayPosition::None => { - work_area_y + work_area_height - OVERLAY_OFFSET + // don't subtract the overlay height it puts it too far up + work_area_y + work_area_height - OVERLAY_BOTTOM_OFFSET } };