diff --git a/modules/ui/Interactions.qml b/modules/ui/Interactions.qml index 980dae2..f3d601e 100644 --- a/modules/ui/Interactions.qml +++ b/modules/ui/Interactions.qml @@ -21,29 +21,32 @@ CustomMouseArea { property bool dashboardShortcutActive anchors.fill: parent + // HACK: Fixes weird pixel alignment issues that drop mouse events + anchors.rightMargin: -1 + anchors.bottomMargin: -1 + hoverEnabled: true function withinPanelWidth(panel: Item, x: real): bool { - const panelX = panel.x; + const panelX = panel.x + Config.border.thickness; return x >= panelX - Config.border.rounding && x <= panelX + panel.width + Config.border.rounding; } function withinPanelHeight(panel: Item, y: real): bool { - const panelY = panel.y; - return y >= panelY + Config.bar.height - Config.border.rounding - && y <= panelY + panel.height + Config.bar.height + Config.border.rounding; + const panelY = panel.y + Config.bar.height; + return y >= panelY - Config.border.rounding && y <= panelY + panel.height + Config.border.rounding; } function inBottomPanel(panel: Item, x: real, y: real): bool { - return y > root.height - Config.border.thickness - panel.height - Config.border.rounding && withinPanelWidth(panel, x); + return y > panel.y + Config.bar.height && withinPanelWidth(panel, x); } function inLeftPanel(panel: Item, x: real, y: real): bool { - return x < Config.border.thickness + panel.x + panel.width && withinPanelHeight(panel, y); + return x < panel.x + panel.width + Config.border.thickness && withinPanelHeight(panel, y); } function inRightPanel(panel: Item, x: real, y: real): bool { - return x > Config.border.thickness + panel.x && withinPanelHeight(panel, y); + return x > panel.x + Config.border.thickness && withinPanelHeight(panel, y); } // Handling Mouse Input