mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-18 09:14:01 -04:00
bar/island: fix click targets on satellites
This commit is contained in:
@@ -68,7 +68,10 @@ Item {
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.clicked()
|
||||
|
||||
@@ -60,7 +60,10 @@ BasePill {
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: function (mouse) {
|
||||
|
||||
@@ -27,7 +27,10 @@ BasePill {
|
||||
|
||||
MouseArea {
|
||||
z: 1
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => {
|
||||
root.triggerRipple(this, mouse.x, mouse.y);
|
||||
|
||||
@@ -111,7 +111,10 @@ BasePill {
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onPressed: mouse => {
|
||||
|
||||
@@ -111,7 +111,10 @@ BasePill {
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onPressed: mouse => {
|
||||
|
||||
@@ -270,7 +270,10 @@ BasePill {
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
z: 1
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
hoverEnabled: root.isVerticalOrientation
|
||||
onEntered: {
|
||||
if (root.isVerticalOrientation && root.selectedMount) {
|
||||
|
||||
@@ -379,7 +379,10 @@ BasePill {
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
hoverEnabled: root.isVerticalOrientation
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onEntered: {
|
||||
|
||||
@@ -179,7 +179,10 @@ BasePill {
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onPressed: mouse => {
|
||||
|
||||
@@ -27,7 +27,10 @@ BasePill {
|
||||
|
||||
MouseArea {
|
||||
z: 1
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => {
|
||||
root.triggerRipple(this, mouse.x, mouse.y);
|
||||
|
||||
@@ -99,7 +99,10 @@ BasePill {
|
||||
|
||||
MouseArea {
|
||||
z: 1
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => {
|
||||
root.triggerRipple(this, mouse.x, mouse.y);
|
||||
|
||||
@@ -143,7 +143,10 @@ BasePill {
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onPressed: mouse => {
|
||||
root.triggerRipple(this, mouse.x, mouse.y);
|
||||
|
||||
@@ -65,7 +65,10 @@ BasePill {
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
acceptedButtons: Qt.MiddleButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => {
|
||||
|
||||
@@ -146,7 +146,10 @@ BasePill {
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onPressed: mouse => {
|
||||
|
||||
@@ -397,7 +397,10 @@ BasePill {
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
y: root.isVerticalOrientation ? 0 : -root.topMargin
|
||||
x: root.isVerticalOrientation ? -root.leftMargin : 0
|
||||
width: parent.width + (root.isVerticalOrientation ? root.leftMargin + root.rightMargin : 0)
|
||||
height: parent.height + (root.isVerticalOrientation ? 0 : root.topMargin + root.bottomMargin)
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||
@@ -651,7 +654,10 @@ BasePill {
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
y: root.isVerticalOrientation ? 0 : -root.topMargin
|
||||
x: root.isVerticalOrientation ? -root.leftMargin : 0
|
||||
width: parent.width + (root.isVerticalOrientation ? root.leftMargin + root.rightMargin : 0)
|
||||
height: parent.height + (root.isVerticalOrientation ? 0 : root.topMargin + root.bottomMargin)
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||
|
||||
@@ -570,7 +570,10 @@ BasePill {
|
||||
|
||||
MouseArea {
|
||||
id: trayItemArea
|
||||
anchors.fill: parent
|
||||
y: root.isVerticalOrientation ? 0 : -root.topMargin
|
||||
x: root.isVerticalOrientation ? -root.leftMargin : 0
|
||||
width: parent.width + (root.isVerticalOrientation ? root.leftMargin + root.rightMargin : 0)
|
||||
height: parent.height + (root.isVerticalOrientation ? 0 : root.topMargin + root.bottomMargin)
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
cursorShape: dragHandler.longPressing ? Qt.DragMoveCursor : Qt.PointingHandCursor
|
||||
@@ -777,7 +780,10 @@ BasePill {
|
||||
|
||||
MouseArea {
|
||||
id: inlineTrayItemArea
|
||||
anchors.fill: parent
|
||||
y: root.isVerticalOrientation ? 0 : -root.topMargin
|
||||
x: root.isVerticalOrientation ? -root.leftMargin : 0
|
||||
width: parent.width + (root.isVerticalOrientation ? root.leftMargin + root.rightMargin : 0)
|
||||
height: parent.height + (root.isVerticalOrientation ? 0 : root.topMargin + root.bottomMargin)
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
@@ -896,7 +902,10 @@ BasePill {
|
||||
|
||||
MouseArea {
|
||||
id: trayItemArea
|
||||
anchors.fill: parent
|
||||
y: root.isVerticalOrientation ? 0 : -root.topMargin
|
||||
x: root.isVerticalOrientation ? -root.leftMargin : 0
|
||||
width: parent.width + (root.isVerticalOrientation ? root.leftMargin + root.rightMargin : 0)
|
||||
height: parent.height + (root.isVerticalOrientation ? 0 : root.topMargin + root.bottomMargin)
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
cursorShape: dragHandler.longPressing ? Qt.DragMoveCursor : Qt.PointingHandCursor
|
||||
|
||||
@@ -158,7 +158,10 @@ BasePill {
|
||||
|
||||
MouseArea {
|
||||
z: 1
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: mouse => {
|
||||
root.triggerRipple(this, mouse.x, mouse.y);
|
||||
|
||||
@@ -65,7 +65,10 @@ BasePill {
|
||||
MouseArea {
|
||||
id: clickArea
|
||||
|
||||
anchors.fill: parent
|
||||
x: -root.leftMargin
|
||||
y: -root.topMargin
|
||||
width: root.width + root.leftMargin + root.rightMargin
|
||||
height: root.height + root.topMargin + root.bottomMargin
|
||||
hoverEnabled: true
|
||||
cursorShape: DMSNetworkService.isBusy ? Qt.BusyCursor : Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
@@ -21,6 +21,7 @@ Item {
|
||||
property var blurBarWindow: null
|
||||
property var hyprlandOverviewLoader: null
|
||||
property var parentScreen: null
|
||||
property real crossEdgeExtension: 0
|
||||
|
||||
readonly property bool isMango: CompositorService.isMango
|
||||
|
||||
@@ -45,7 +46,7 @@ Item {
|
||||
}
|
||||
readonly property real _topMargin: {
|
||||
if (!isVertical)
|
||||
return 0;
|
||||
return axis?.edge === "top" ? crossEdgeExtension : 0;
|
||||
root.y;
|
||||
if (!root.parent)
|
||||
return 0;
|
||||
@@ -54,7 +55,7 @@ Item {
|
||||
}
|
||||
readonly property real _bottomMargin: {
|
||||
if (!isVertical)
|
||||
return 0;
|
||||
return axis?.edge === "bottom" ? crossEdgeExtension : 0;
|
||||
root.y;
|
||||
root.height;
|
||||
if (!root.parent || !blurBarWindow)
|
||||
|
||||
@@ -26,7 +26,7 @@ PanelWindow {
|
||||
|
||||
function containsGlobalPoint(gx, gy, padding) {
|
||||
const pad = padding !== undefined ? padding : 16;
|
||||
const items = [surface.inputMaskItem, surface.mediaDropdownMaskItem, satelliteHost.leftInputItem, satelliteHost.rightInputItem];
|
||||
const items = [surface.inputMaskItem, surface.fittsStripItem, surface.mediaDropdownMaskItem, satelliteHost.leftInputItem, satelliteHost.rightInputItem];
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
const item = items[i];
|
||||
if (!item || item.width <= 0 || item.height <= 0)
|
||||
@@ -126,6 +126,10 @@ PanelWindow {
|
||||
item: controller.inputSuspended ? null : surface.inputMaskItem
|
||||
}
|
||||
|
||||
Region {
|
||||
item: controller.inputSuspended ? null : surface.fittsStripItem
|
||||
}
|
||||
|
||||
Region {
|
||||
item: controller.inputSuspended ? null : satelliteHost.leftInputItem
|
||||
}
|
||||
@@ -319,6 +323,11 @@ PanelWindow {
|
||||
intersection: Intersection.Subtract
|
||||
}
|
||||
|
||||
Region {
|
||||
item: fittsStripHole
|
||||
intersection: Intersection.Subtract
|
||||
}
|
||||
|
||||
Region {
|
||||
item: leftSatelliteHole
|
||||
intersection: Intersection.Subtract
|
||||
@@ -352,6 +361,15 @@ PanelWindow {
|
||||
height: surface.inputMaskItem.height
|
||||
}
|
||||
|
||||
Item {
|
||||
id: fittsStripHole
|
||||
|
||||
x: surface.fittsStripItem.x
|
||||
y: surface.fittsStripItem.y + root.hostOriginY
|
||||
width: surface.fittsStripItem.visible ? surface.fittsStripItem.width : 0
|
||||
height: surface.fittsStripItem.visible ? surface.fittsStripItem.height : 0
|
||||
}
|
||||
|
||||
Item {
|
||||
id: leftSatelliteHole
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ Item {
|
||||
signal scrollWheel(var wheel)
|
||||
|
||||
readonly property alias inputMaskItem: inputEnvelope
|
||||
readonly property alias fittsStripItem: fittsStrip
|
||||
readonly property bool motionRunning: motion.running
|
||||
readonly property real springTimeConstantMs: motion.timeConstantMs
|
||||
property real trackedHeight: 0
|
||||
@@ -281,7 +282,45 @@ Item {
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
onHoveredChanged: root.controller.updatePointerInside(hovered)
|
||||
id: islandHover
|
||||
|
||||
onHoveredChanged: root.updateFittsPointerInside()
|
||||
}
|
||||
}
|
||||
|
||||
function updateFittsPointerInside() {
|
||||
root.controller.updatePointerInside(islandHover.hovered || stripHover.hovered);
|
||||
}
|
||||
|
||||
// Fitts zone from the island edge to the screen edge — hover/click count as island.
|
||||
// Bounds follow the spring target, never the per-frame value, so the Wayland mask is not
|
||||
// rewritten every frame and the strip never shrinks out from under the cursor mid-open.
|
||||
Item {
|
||||
id: fittsStrip
|
||||
|
||||
readonly property real spanWidth: Math.max(root.controller.compactTarget.width, motion.targetWidth)
|
||||
readonly property real edgeGap: root.bottomEdge ? Math.max(0, root.height - (root.targetVisualY + motion.targetHeight)) : Math.max(0, root.targetVisualY)
|
||||
|
||||
x: Math.round((root.width - spanWidth) / 2 + motion.targetOffsetX)
|
||||
y: root.bottomEdge ? root.targetVisualY + motion.targetHeight : 0
|
||||
width: spanWidth
|
||||
height: edgeGap
|
||||
visible: edgeGap > 0 && spanWidth > 0
|
||||
|
||||
HoverHandler {
|
||||
id: stripHover
|
||||
|
||||
onHoveredChanged: root.updateFittsPointerInside()
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onClicked: root.controller.requestToggle(true)
|
||||
onWheel: wheel => {
|
||||
root.scrollWheel(wheel);
|
||||
wheel.accepted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,14 @@ Item {
|
||||
property var blurBarWindow: null
|
||||
property string pluginId: ""
|
||||
property var pluginService: null
|
||||
property bool isFirst: false
|
||||
property bool isLast: false
|
||||
property bool isLeftBarEdge: false
|
||||
property bool isRightBarEdge: false
|
||||
property bool isTopBarEdge: false
|
||||
property bool isBottomBarEdge: false
|
||||
property real sectionSpacing: 0
|
||||
property real crossEdgeExtension: 0
|
||||
|
||||
property string visibilityCommand: ""
|
||||
property int visibilityInterval: 0
|
||||
@@ -191,6 +199,14 @@ Item {
|
||||
barConfig: root.barConfig
|
||||
blurBarWindow: root.blurBarWindow
|
||||
content: root.horizontalBarPill
|
||||
isFirst: root.isFirst
|
||||
isLast: root.isLast
|
||||
isLeftBarEdge: root.isLeftBarEdge
|
||||
isRightBarEdge: root.isRightBarEdge
|
||||
isTopBarEdge: root.isTopBarEdge
|
||||
isBottomBarEdge: root.isBottomBarEdge
|
||||
sectionSpacing: root.sectionSpacing
|
||||
crossEdgeExtension: root.crossEdgeExtension
|
||||
|
||||
states: State {
|
||||
name: "hidden"
|
||||
@@ -252,6 +268,14 @@ Item {
|
||||
blurBarWindow: root.blurBarWindow
|
||||
content: root.verticalBarPill
|
||||
isVerticalOrientation: true
|
||||
isFirst: root.isFirst
|
||||
isLast: root.isLast
|
||||
isLeftBarEdge: root.isLeftBarEdge
|
||||
isRightBarEdge: root.isRightBarEdge
|
||||
isTopBarEdge: root.isTopBarEdge
|
||||
isBottomBarEdge: root.isBottomBarEdge
|
||||
sectionSpacing: root.sectionSpacing
|
||||
crossEdgeExtension: root.crossEdgeExtension
|
||||
|
||||
states: State {
|
||||
name: "hidden"
|
||||
|
||||
Reference in New Issue
Block a user