diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2024-04-23 15:17:41 +0300 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2024-04-23 13:53:55 +0000 |
commit | 63107ff2f7ce9b42bf94612eb0238d8167fff146 (patch) | |
tree | 743cd26c307557de18f50cda4cc5501eebb3bf2f /share/qtcreator | |
parent | 651d7f5d8504fa6d0311fb23dd172ade34d44da2 (diff) |
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>
Diffstat (limited to 'share/qtcreator')
-rw-r--r-- | share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryUserView.qml | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryUserView.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryUserView.qml index 85123af374..1288e14c2a 100644 --- a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryUserView.qml +++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryUserView.qml @@ -12,8 +12,8 @@ HelperWidgets.ScrollView { id: root clip: true - interactive: !ctxMenu.opened && !ContentLibraryBackend.rootView.isDragging - && !HelperWidgets.Controller.contextMenuOpened + interactive: !ctxMenuMaterial.opened && !ctxMenuTexture.opened + && !ContentLibraryBackend.rootView.isDragging && !HelperWidgets.Controller.contextMenuOpened property real cellWidth: 100 property real cellHeight: 120 @@ -33,7 +33,8 @@ HelperWidgets.ScrollView { signal unimport(var bundleItem); function closeContextMenu() { - ctxMenu.close() + ctxMenuMaterial.close() + ctxMenuTexture.close() } function expandVisibleSections() { @@ -46,15 +47,21 @@ HelperWidgets.ScrollView { Column { ContentLibraryMaterialContextMenu { - id: ctxMenu + id: ctxMenuMaterial hasModelSelection: ContentLibraryBackend.userModel.hasModelSelection 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) - onAddToProject: ContentLibraryBackend.userModel.addToProject(ctxMenu.targetMaterial) + onUnimport: root.unimport(ctxMenuMaterial.targetMaterial) + onAddToProject: ContentLibraryBackend.userModel.addToProject(ctxMenuMaterial.targetMaterial) + } + + ContentLibraryTextureContextMenu { + id: ctxMenuTexture + + hasSceneEnv: ContentLibraryBackend.texturesModel.hasSceneEnv } Repeater { @@ -105,7 +112,7 @@ HelperWidgets.ScrollView { importerRunning: ContentLibraryBackend.userModel.importerRunning - onShowContextMenu: ctxMenu.popupMenu(modelData) + onShowContextMenu: ctxMenuMaterial.popupMenu(modelData) onAddToProject: ContentLibraryBackend.userModel.addToProject(modelData) onVisibleChanged: { @@ -119,7 +126,7 @@ HelperWidgets.ScrollView { width: root.cellWidth height: root.cellWidth // for textures use a square size since there is no name row - // onShowContextMenu: ctxMenu.popupMenu(modelData) // TODO + onShowContextMenu: ctxMenuTexture.popupMenu(modelData) } } } |