Skip to content

Commit 341b1b8

Browse files
yixinsharkdeepin-bot[bot]
authored andcommitted
fix: Application tray button can accept right mouse button to open popup window
application tray Button only accepts left-click mouse button to open the popup window , and left-click or right-click to close the pop-up window Log: as title Pms: BUG-293895
1 parent 81d8a13 commit 341b1b8

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

panels/dock/AppletItemBackground.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ import QtQuick.Controls
88
import org.deepin.ds.dock 1.0
99
import org.deepin.dtk
1010

11-
Item {
11+
MouseArea {
1212
id: control
1313
property bool isActive
1414
property real radius: 4
1515

16+
// can accept mouse event,prevent further event delivery
17+
acceptedButtons: Qt.LeftButton | Qt.RightButton
1618
implicitWidth: 24
1719
implicitHeight: 24
1820
property Palette backgroundColor: Palette {

panels/dock/tray/package/ActionShowStashDelegate.qml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ AppletItemButton {
2525

2626
padding: itemPadding
2727

28-
D.ColorSelector.hovered: (isDropHover && DDT.TraySortOrderModel.actionsAlwaysVisible) || hoverHandler.hovered || stashedPopup.popupVisible
28+
D.ColorSelector.hovered: (isDropHover && DDT.TraySortOrderModel.actionsAlwaysVisible) || hovered || stashedPopup.popupVisible
2929

3030
property var itemGlobalPoint: {
3131
var a = root
@@ -95,11 +95,11 @@ AppletItemButton {
9595

9696
onClicked: {
9797
if (stashedPopup.popupVisible) {
98-
stashedPopup.close();
98+
stashedPopup.close()
9999
} else {
100-
stashedPopup.open();
100+
stashedPopup.open()
101101
}
102-
toolTip.close();
102+
toolTip.close()
103103
}
104104

105105
PanelToolTip {
@@ -117,18 +117,21 @@ AppletItemButton {
117117
toolTip.open()
118118
}
119119
}
120-
HoverHandler {
121-
id: hoverHandler
122-
onHoveredChanged: {
123-
if (hovered) {
124-
toolTipShowTimer.start()
125-
} else {
126-
if (toolTipShowTimer.running) {
127-
toolTipShowTimer.stop()
128-
}
129-
130-
toolTip.close()
120+
121+
onHoveredChanged: {
122+
if (stashedPopup.popupVisible) {
123+
return
124+
}
125+
126+
if (hovered) {
127+
toolTipShowTimer.start()
128+
} else {
129+
if (toolTipShowTimer.running) {
130+
toolTipShowTimer.stop()
131131
}
132+
133+
toolTip.close()
132134
}
133135
}
136+
134137
}

panels/dock/tray/package/ActionToggleCollapseDelegate.qml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,17 @@ AppletItemButton {
6464
toolTip.open()
6565
}
6666
}
67-
HoverHandler {
68-
id: hoverHandler
69-
enabled: root.inputEventsEnabled
70-
onHoveredChanged: {
71-
if (hovered) {
72-
toolTipShowTimer.start()
73-
} else {
74-
if (toolTipShowTimer.running) {
75-
toolTipShowTimer.stop()
76-
}
7767

78-
toolTip.close()
68+
69+
onHoveredChanged: {
70+
if (hovered) {
71+
toolTipShowTimer.start()
72+
} else {
73+
if (toolTipShowTimer.running) {
74+
toolTipShowTimer.stop()
7975
}
76+
77+
toolTip.close()
8078
}
8179
}
8280
}

0 commit comments

Comments
 (0)