forked from qt-creator/qt-creator
Fixes: QDS-9683 Fixes: QDS-10167 Fixes: QDS-10171 Fixes: QDS-10191 Fixes: QDS-10192 Change-Id: Ia6f764737783277c719109b28fad248ae3ea2990 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
40 lines
1.1 KiB
QML
40 lines
1.1 KiB
QML
// Copyright (C) 2023 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
import QtQuick
|
|
import HelperWidgets
|
|
import StudioControls as StudioControls
|
|
import StudioTheme as StudioTheme
|
|
import ContentLibraryBackend
|
|
|
|
StudioControls.Menu {
|
|
id: root
|
|
|
|
property var targetItem: null
|
|
|
|
readonly property bool targetAvailable: targetItem && !ContentLibraryBackend.effectsModel.importerRunning
|
|
|
|
signal unimport(var bundleEff);
|
|
|
|
function popupMenu(targetItem = null)
|
|
{
|
|
this.targetItem = targetItem
|
|
popup()
|
|
}
|
|
|
|
closePolicy: StudioControls.Menu.CloseOnEscape | StudioControls.Menu.CloseOnPressOutside
|
|
|
|
StudioControls.MenuItem {
|
|
text: qsTr("Add an instance")
|
|
enabled: root.targetAvailable
|
|
onTriggered: ContentLibraryBackend.effectsModel.addInstance(root.targetItem)
|
|
}
|
|
|
|
StudioControls.MenuItem {
|
|
enabled: root.targetAvailable && root.targetItem.bundleItemImported
|
|
text: qsTr("Remove from project")
|
|
|
|
onTriggered: root.unimport(root.targetItem)
|
|
}
|
|
}
|