From 97406dfe9761ebac2f32375e67c7b7b8428cfc88 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 15 May 2025 23:18:19 +0800 Subject: interactions: fix mouse position Didn't account for border thickness --- modules/drawers/Interactions.qml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'modules/drawers/Interactions.qml') diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml index 884d36c..e937326 100644 --- a/modules/drawers/Interactions.qml +++ b/modules/drawers/Interactions.qml @@ -14,11 +14,13 @@ MouseArea { property point dragStart function withinPanelHeight(panel: Item, x: real, y: real): bool { - return y >= panel.y && y <= panel.y + panel.height; + const panelY = BorderConfig.thickness + panel.y; + return y >= panelY && y <= panelY + panel.height; } function inRightPanel(panel: Item, x: real, y: real): bool { - return x > panel.x && withinPanelHeight(panel, x, y); + return x > BorderConfig.thickness + panel.x && withinPanelHeight(panel, x, y); + } } anchors.fill: parent @@ -30,7 +32,10 @@ MouseArea { target: Hyprland function onCursorPosChanged(): void { - const {x, y} = Hyprland.cursorPos; + const { + x, + y + } = Hyprland.cursorPos; // Show osd on hover const showOsd = root.inRightPanel(panels.osd, x, y); -- cgit v1.2.3-freya