Click the middle mouse button to open a new window

This commit is contained in:
reionwong 2021-06-16 11:37:27 +08:00
parent 38fb82e0b1
commit 2b40e07e8a
2 changed files with 10 additions and 12 deletions

View file

@ -51,9 +51,15 @@ DockItem {
onPositionChanged: updateGeometry() onPositionChanged: updateGeometry()
onPressed: updateGeometry() onPressed: updateGeometry()
onClicked: appModel.clicked(model.appId)
onRightClicked: if (model.appId !== "cutefish-launcher") contextMenu.show() onRightClicked: if (model.appId !== "cutefish-launcher") contextMenu.show()
onClicked: {
if (mouse.button === Qt.LeftButton)
appModel.clicked(model.appId)
else if (mouse.button === Qt.MiddleButton)
appModel.openNewInstance(model.appId)
}
dropArea.onEntered: { dropArea.onEntered: {
if (drag.source) if (drag.source)
appModel.move(drag.source.dragItemIndex, appItem.dragItemIndex) appModel.move(drag.source.dragItemIndex, appItem.dragItemIndex)

View file

@ -100,7 +100,7 @@ Item {
id: iconArea id: iconArea
anchors.fill: icon anchors.fill: icon
hoverEnabled: true hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
drag.axis: Drag.XAndYAxis drag.axis: Drag.XAndYAxis
onClicked: { onClicked: {
@ -177,28 +177,20 @@ Item {
radius: !isBottom ? width / 2 : height / 2 radius: !isBottom ? width / 2 : height / 2
visible: enableActivateDot && !dragStarted visible: enableActivateDot && !dragStarted
color: FishUI.Theme.textColor color: FishUI.Theme.textColor
opacity: 1.0
x: isLeft ? leftX : isBottom ? bottomX : rightX x: isLeft ? leftX : isBottom ? bottomX : rightX
y: isLeft ? leftY : isBottom ? bottomY : rightY y: isLeft ? leftY : isBottom ? bottomY : rightY
Behavior on opacity {
NumberAnimation {
duration: 200
easing.type: Easing.InOutSine
}
}
Behavior on width { Behavior on width {
NumberAnimation { NumberAnimation {
duration: isBottom ? 200 : 0 duration: isBottom ? 250 : 0
easing.type: Easing.InOutSine easing.type: Easing.InOutSine
} }
} }
Behavior on height { Behavior on height {
NumberAnimation { NumberAnimation {
duration: !isBottom ? 200 : 0 duration: !isBottom ? 250 : 0
easing.type: Easing.InOutSine easing.type: Easing.InOutSine
} }
} }