From 2b40e07e8a27072d5c035e7bfa597360d519d118 Mon Sep 17 00:00:00 2001 From: reionwong Date: Wed, 16 Jun 2021 11:37:27 +0800 Subject: [PATCH] Click the middle mouse button to open a new window --- qml/AppItem.qml | 8 +++++++- qml/DockItem.qml | 14 +++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/qml/AppItem.qml b/qml/AppItem.qml index 625697c..e6c75a2 100644 --- a/qml/AppItem.qml +++ b/qml/AppItem.qml @@ -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) diff --git a/qml/DockItem.qml b/qml/DockItem.qml index f75b3a1..23f4228 100644 --- a/qml/DockItem.qml +++ b/qml/DockItem.qml @@ -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 } }