Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions panels/dock/taskmanager/package/AppItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Item {
property bool enableTitle: false
property bool titleActive: enableTitle && titleLoader.active
property bool preservePanelPopupOnContextMenu: false
property var contextMenuGuard: null
property bool updateIconGeometry: true
property Item previewAnchor: icon
// Folder content replaces the overflow popup, so anchor it to the dock.
Expand Down Expand Up @@ -504,6 +505,10 @@ Item {
property bool trashEmpty: true
sourceComponent: LP.Menu {
id: contextMenu
onAboutToHide: Qt.callLater(function() {
if (MenuHelper.activeMenu === null && root.contextMenuGuard)
Comment thread
wjyrich marked this conversation as resolved.
Resolved
root.contextMenuGuard(false)
})
Instantiator {
id: menuItemInstantiator
model: JSON.parse(menus)
Expand Down Expand Up @@ -596,6 +601,8 @@ Item {
}

function requestAppItemMenu() {
if (root.contextMenuGuard)
Comment thread
wjyrich marked this conversation as resolved.
Resolved
root.contextMenuGuard(true)
if (!root.preservePanelPopupOnContextMenu) {
Panel.requestClosePopup()
}
Expand Down
9 changes: 8 additions & 1 deletion panels/dock/taskmanager/package/TaskOverflowButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Item {
readonly property int popupColumns: Math.min(6, Math.max(1, overflowCount),
Math.max(1, Math.floor((popupAvailableWidth - 20) / popupCellWidth)))
property point popupAnchorPoint: Qt.point(0, 0)
property bool contextMenuActive: false

visible: overflowCount > 0 && overflow.buttonExtent > 0
x: root.taskManagerItem.useColumnLayout ? 0 : root.buttonOffset
Expand Down Expand Up @@ -136,6 +137,10 @@ Item {
overflowPopup.open()
}

function guardContextMenu(active) {
contextMenuActive = active
}

AppItemBackground {
width: root.hoverBackgroundWidth
height: root.hoverBackgroundHeight
Expand Down Expand Up @@ -220,7 +225,8 @@ Item {
contentReady: popupContentLoader.status === Loader.Ready
popupX: DockPanelPositioner.x
popupY: DockPanelPositioner.y
closeOnInactive: MenuHelper.activeMenu === null && !Panel.contextDragging
closeOnInactive: !root.contextMenuActive
Comment thread
wjyrich marked this conversation as resolved.
Resolved
&& MenuHelper.activeMenu === null && !Panel.contextDragging

Component.onCompleted: {
DockPanelPositioner.bounding = Qt.binding(function () {
Expand Down Expand Up @@ -307,6 +313,7 @@ Item {
title: popupDelegate.entry.title
enableTitle: false
preservePanelPopupOnContextMenu: true
contextMenuGuard: root.guardContextMenu
previewAnchor: overflowPopupContent
folderAnchor: root
updateIconGeometry: false
Expand Down
Loading