Block tree context menu in blank area
This commit is contained in:
+12
-17
@@ -955,23 +955,18 @@ class GuiProjectTree(QTreeView):
|
|||||||
if model := self._getModel():
|
if model := self._getModel():
|
||||||
if point is None:
|
if point is None:
|
||||||
point = self.visualRect(self.currentIndex()).center()
|
point = self.visualRect(self.currentIndex()).center()
|
||||||
|
if point is not None:
|
||||||
if (
|
index = self.indexAt(point)
|
||||||
point is not None
|
if (node := self._getNode(index)) and (indices := self._selectedRows()):
|
||||||
and (node := self._getNode(self.currentIndex()))
|
ctxMenu = _TreeContextMenu(self, model, node, indices)
|
||||||
and (indices := self._selectedRows())
|
if node is SHARED.project.tree.trash:
|
||||||
):
|
ctxMenu.buildTrashMenu()
|
||||||
ctxMenu = _TreeContextMenu(self, model, node, indices)
|
elif len(indices) > 1:
|
||||||
if node is SHARED.project.tree.trash:
|
ctxMenu.buildMultiSelectMenu()
|
||||||
ctxMenu.buildTrashMenu()
|
else:
|
||||||
elif len(indices) > 1:
|
ctxMenu.buildSingleSelectMenu()
|
||||||
ctxMenu.buildMultiSelectMenu()
|
ctxMenu.exec(self.viewport().mapToGlobal(point))
|
||||||
else:
|
ctxMenu.setParent(None)
|
||||||
ctxMenu.buildSingleSelectMenu()
|
|
||||||
|
|
||||||
ctxMenu.exec(self.viewport().mapToGlobal(point))
|
|
||||||
ctxMenu.setParent(None)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|||||||
Reference in New Issue
Block a user