drawers: fix interaction areas

Outer corners shouldn't be part of interaction area
This commit is contained in:
2 * r + 2 * t 2025-06-05 18:41:45 +10:00
parent d37b3926c8
commit 023d00d658
14 changed files with 21 additions and 24 deletions

View file

@ -34,7 +34,7 @@ ShapePath {
} }
PathLine { PathLine {
relativeX: 0 relativeX: 0
relativeY: root.wrapper.height - root.rounding * 4 relativeY: root.wrapper.height - root.rounding * 2
} }
PathArc { PathArc {
relativeX: root.invertBottomRounding ? root.roundingX : -root.roundingX relativeX: root.invertBottomRounding ? root.roundingX : -root.roundingX

View file

@ -11,7 +11,7 @@ Item {
visible: width > 0 && height > 0 visible: width > 0 && height > 0
implicitWidth: content.implicitWidth implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight + BorderConfig.rounding * 2 implicitHeight: content.implicitHeight
Content { Content {
id: content id: content

View file

@ -35,7 +35,7 @@ ShapePath {
} }
PathLine { PathLine {
relativeX: root.wrapper.width - root.rounding * 4 relativeX: root.wrapper.width - root.rounding * 2
relativeY: 0 relativeY: 0
} }
@ -65,7 +65,5 @@ ShapePath {
easing.type: Easing.BezierSpline easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard easing.bezierCurve: Appearance.anim.curves.standard
} }
} }
} }

View file

@ -9,7 +9,7 @@ Item {
visible: height > 0 visible: height > 0
implicitHeight: 0 implicitHeight: 0
implicitWidth: content.implicitWidth + BorderConfig.rounding * 2 implicitWidth: content.implicitWidth
states: State { states: State {
name: "visible" name: "visible"

View file

@ -22,7 +22,7 @@ Shape {
wrapper: panels.osd wrapper: panels.osd
startX: root.width - panels.session.width startX: root.width - panels.session.width
startY: (root.height - wrapper.height) / 2 startY: (root.height - wrapper.height) / 2 - rounding
} }
Notifications.Background { Notifications.Background {
@ -36,20 +36,20 @@ Shape {
wrapper: panels.session wrapper: panels.session
startX: root.width startX: root.width
startY: (root.height - wrapper.height) / 2 startY: (root.height - wrapper.height) / 2 - rounding
} }
Launcher.Background { Launcher.Background {
wrapper: panels.launcher wrapper: panels.launcher
startX: (root.width - wrapper.width) / 2 startX: (root.width - wrapper.width) / 2 - rounding
startY: root.height startY: root.height
} }
Dashboard.Background { Dashboard.Background {
wrapper: panels.dashboard wrapper: panels.dashboard
startX: (root.width - wrapper.width) / 2 startX: (root.width - wrapper.width) / 2 - rounding
startY: 0 startY: 0
} }
@ -58,6 +58,6 @@ Shape {
invertBottomRounding: wrapper.y + wrapper.height - BorderConfig.rounding >= root.height invertBottomRounding: wrapper.y + wrapper.height - BorderConfig.rounding >= root.height
startX: 0 startX: 0
startY: wrapper.y startY: wrapper.y - rounding
} }
} }

View file

@ -16,7 +16,7 @@ MouseArea {
function withinPanelHeight(panel: Item, x: real, y: real): bool { function withinPanelHeight(panel: Item, x: real, y: real): bool {
const panelY = BorderConfig.thickness + panel.y; const panelY = BorderConfig.thickness + panel.y;
return y >= panelY && y <= panelY + panel.height; return y >= panelY - BorderConfig.rounding && y <= panelY + panel.height + BorderConfig.rounding;
} }
function inRightPanel(panel: Item, x: real, y: real): bool { function inRightPanel(panel: Item, x: real, y: real): bool {
@ -25,7 +25,7 @@ MouseArea {
function inTopPanel(panel: Item, x: real, y: real): bool { function inTopPanel(panel: Item, x: real, y: real): bool {
const panelX = BorderConfig.thickness + panel.x; const panelX = BorderConfig.thickness + panel.x;
return y < BorderConfig.thickness + panel.y + panel.height && x >= panelX && x <= panelX + panel.width; return y < BorderConfig.thickness + panel.y + panel.height && x >= panelX - BorderConfig.rounding && x <= panelX + panel.width + BorderConfig.rounding;
} }
anchors.fill: parent anchors.fill: parent
@ -57,8 +57,7 @@ MouseArea {
} }
// Show dashboard on hover // Show dashboard on hover
const showDashboard = root.inTopPanel(panels.dashboard, x, y); visibilities.dashboard = inTopPanel(panels.dashboard, x, y);
visibilities.dashboard = showDashboard;
// Show popouts on hover // Show popouts on hover
const popout = panels.popouts; const popout = panels.popouts;

View file

@ -32,7 +32,7 @@ ShapePath {
radiusY: Math.min(root.rounding, root.wrapper.height) radiusY: Math.min(root.rounding, root.wrapper.height)
} }
PathLine { PathLine {
relativeX: root.wrapper.width - root.rounding * 4 relativeX: root.wrapper.width - root.rounding * 2
relativeY: 0 relativeY: 0
} }
PathArc { PathArc {

View file

@ -9,7 +9,7 @@ Item {
visible: height > 0 visible: height > 0
implicitHeight: 0 implicitHeight: 0
implicitWidth: content.implicitWidth + BorderConfig.rounding * 2 implicitWidth: content.implicitWidth
states: State { states: State {
name: "visible" name: "visible"

View file

@ -17,7 +17,7 @@ ShapePath {
fillColor: BorderConfig.colour fillColor: BorderConfig.colour
PathLine { PathLine {
relativeX: -root.wrapper.width relativeX: -(root.wrapper.width + root.rounding)
relativeY: 0 relativeY: 0
} }
PathArc { PathArc {
@ -38,7 +38,7 @@ ShapePath {
direction: root.fullHeightRounding < 0 ? PathArc.Clockwise : PathArc.Counterclockwise direction: root.fullHeightRounding < 0 ? PathArc.Clockwise : PathArc.Counterclockwise
} }
PathLine { PathLine {
relativeX: root.wrapper.height > 0 ? root.wrapper.width - root.rounding * 2 - root.fullHeightRounding : root.wrapper.width relativeX: root.wrapper.height > 0 ? root.wrapper.width - root.rounding - root.fullHeightRounding : root.wrapper.width
relativeY: 0 relativeY: 0
} }
PathArc { PathArc {

View file

@ -6,7 +6,7 @@ Item {
visible: height > 0 visible: height > 0
implicitHeight: content.implicitHeight implicitHeight: content.implicitHeight
implicitWidth: content.implicitWidth + BorderConfig.rounding implicitWidth: content.implicitWidth
Content { Content {
id: content id: content

View file

@ -33,7 +33,7 @@ ShapePath {
} }
PathLine { PathLine {
relativeX: 0 relativeX: 0
relativeY: root.wrapper.height - root.rounding * 4 relativeY: root.wrapper.height - root.rounding * 2
} }
PathArc { PathArc {
relativeX: root.roundingX relativeX: root.roundingX

View file

@ -11,7 +11,7 @@ Item {
visible: width > 0 visible: width > 0
implicitWidth: 0 implicitWidth: 0
implicitHeight: content.implicitHeight + BorderConfig.rounding * 2 implicitHeight: content.implicitHeight
states: State { states: State {
name: "visible" name: "visible"

View file

@ -33,7 +33,7 @@ ShapePath {
} }
PathLine { PathLine {
relativeX: 0 relativeX: 0
relativeY: root.wrapper.height - root.rounding * 4 relativeY: root.wrapper.height - root.rounding * 2
} }
PathArc { PathArc {
relativeX: root.roundingX relativeX: root.roundingX

View file

@ -10,7 +10,7 @@ Item {
visible: width > 0 visible: width > 0
implicitWidth: 0 implicitWidth: 0
implicitHeight: content.implicitHeight + BorderConfig.rounding * 2 implicitHeight: content.implicitHeight
states: State { states: State {
name: "visible" name: "visible"