Skip to content

Commit

Permalink
fix: can't hide stash popup when AppletItemButton clicked
Browse files Browse the repository at this point in the history
add a property to control whether the popup is automatically hidden when clicked

Issue: linuxdeepin/developer-center#9989
  • Loading branch information
mhduiy committed Aug 27, 2024
1 parent 79543a7 commit d1f0c39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion panels/dock/AppletItemButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

import QtQuick
import QtQuick.Controls

import org.deepin.ds 1.0
import org.deepin.ds.dock 1.0
import org.deepin.dtk

IconButton {
id: control
property bool isActive
property real radius: 4
property bool autoClosePopup: false

padding: 4
topPadding: undefined
Expand All @@ -25,6 +26,14 @@ IconButton {
icon.width: 16
icon.height: 16

Connections {
target: control
enabled: autoClosePopup
function onClicked() {
Panel.requestClosePopup()
}
}

background: AppletItemBackground {
radius: control.radius
isActive: control.isActive
Expand Down
1 change: 1 addition & 0 deletions panels/dock/tray/package/ActionToggleCollapseDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ AppletItemButton {
id: root
property bool isHorizontal: false
property bool collapsed: DDT.TraySortOrderModel.collapsed
autoClosePopup: true

z: 5

Expand Down

0 comments on commit d1f0c39

Please sign in to comment.