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()
onPressed: updateGeometry()
onClicked: appModel.clicked(model.appId)
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: {
if (drag.source)
appModel.move(drag.source.dragItemIndex, appItem.dragItemIndex)

View file

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