Skip to content

Commit 77edac2

Browse files
committed
fix: can't hide stash popup when AppletItemButton clicked
add a property to control whether the popup is automatically hidden when clicked Issue: linuxdeepin/developer-center#9989
1 parent 7e5a1cc commit 77edac2

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

panels/dock/AppletItemButton.qml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
import QtQuick
66
import QtQuick.Controls
7-
7+
import org.deepin.ds 1.0
88
import org.deepin.ds.dock 1.0
99
import org.deepin.dtk
1010

1111
IconButton {
1212
id: control
1313
property bool isActive
1414
property real radius: 4
15+
property bool autoClosePopup: false
1516

1617
padding: 4
1718
topPadding: undefined
@@ -25,6 +26,14 @@ IconButton {
2526
icon.width: 16
2627
icon.height: 16
2728

29+
Connections {
30+
target: control
31+
enabled: autoClosePopup
32+
function onClicked() {
33+
Panel.requestClosePopup()
34+
}
35+
}
36+
2837
background: AppletItemBackground {
2938
radius: control.radius
3039
isActive: control.isActive

panels/dock/tray/package/ActionToggleCollapseDelegate.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ AppletItemButton {
1515
property bool collapsed: DDT.TraySortOrderModel.collapsed
1616
property bool inputEventsEnabled: true
1717
hoverEnabled: inputEventsEnabled
18+
autoClosePopup: true
1819

1920
z: 5
2021

0 commit comments

Comments
 (0)