QmlDesigner: Add content library user textures context menu

Fixes: QDS-12574
Change-Id: I3213d0601167e6963db7fbb1091ade4cb09bdc55
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
(cherry picked from commit 63107ff2f7)
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Mahmoud Badri
2024-04-23 15:17:41 +03:00
committed by Tim Jenssen
parent bbb3b95795
commit f7142be4e5

View File

@@ -12,8 +12,8 @@ HelperWidgets.ScrollView {
id: root id: root
clip: true clip: true
interactive: !ctxMenu.opened && !ContentLibraryBackend.rootView.isDragging interactive: !ctxMenuMaterial.opened && !ctxMenuTexture.opened
&& !HelperWidgets.Controller.contextMenuOpened && !ContentLibraryBackend.rootView.isDragging && !HelperWidgets.Controller.contextMenuOpened
property real cellWidth: 100 property real cellWidth: 100
property real cellHeight: 120 property real cellHeight: 120
@@ -33,7 +33,8 @@ HelperWidgets.ScrollView {
signal unimport(var bundleItem); signal unimport(var bundleItem);
function closeContextMenu() { function closeContextMenu() {
ctxMenu.close() ctxMenuMaterial.close()
ctxMenuTexture.close()
} }
function expandVisibleSections() { function expandVisibleSections() {
@@ -46,15 +47,21 @@ HelperWidgets.ScrollView {
Column { Column {
ContentLibraryMaterialContextMenu { ContentLibraryMaterialContextMenu {
id: ctxMenu id: ctxMenuMaterial
hasModelSelection: ContentLibraryBackend.userModel.hasModelSelection hasModelSelection: ContentLibraryBackend.userModel.hasModelSelection
importerRunning: ContentLibraryBackend.userModel.importerRunning importerRunning: ContentLibraryBackend.userModel.importerRunning
onApplyToSelected: (add) => ContentLibraryBackend.userModel.applyToSelected(ctxMenu.targetMaterial, add) onApplyToSelected: (add) => ContentLibraryBackend.userModel.applyToSelected(ctxMenuMaterial.targetMaterial, add)
onUnimport: root.unimport(ctxMenu.targetMaterial) onUnimport: root.unimport(ctxMenuMaterial.targetMaterial)
onAddToProject: ContentLibraryBackend.userModel.addToProject(ctxMenu.targetMaterial) onAddToProject: ContentLibraryBackend.userModel.addToProject(ctxMenuMaterial.targetMaterial)
}
ContentLibraryTextureContextMenu {
id: ctxMenuTexture
hasSceneEnv: ContentLibraryBackend.texturesModel.hasSceneEnv
} }
Repeater { Repeater {
@@ -105,7 +112,7 @@ HelperWidgets.ScrollView {
importerRunning: ContentLibraryBackend.userModel.importerRunning importerRunning: ContentLibraryBackend.userModel.importerRunning
onShowContextMenu: ctxMenu.popupMenu(modelData) onShowContextMenu: ctxMenuMaterial.popupMenu(modelData)
onAddToProject: ContentLibraryBackend.userModel.addToProject(modelData) onAddToProject: ContentLibraryBackend.userModel.addToProject(modelData)
onVisibleChanged: { onVisibleChanged: {
@@ -119,7 +126,7 @@ HelperWidgets.ScrollView {
width: root.cellWidth width: root.cellWidth
height: root.cellWidth // for textures use a square size since there is no name row height: root.cellWidth // for textures use a square size since there is no name row
// onShowContextMenu: ctxMenu.popupMenu(modelData) // TODO onShowContextMenu: ctxMenuTexture.popupMenu(modelData)
} }
} }
} }