2023-06-29 15:06:11 +03:00
|
|
|
// 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 QtQuick.Controls
|
|
|
|
|
import HelperWidgets
|
|
|
|
|
import StudioControls as StudioControls
|
2024-01-16 12:30:29 +01:00
|
|
|
import StudioTheme as StudioTheme
|
2024-01-26 14:55:50 +02:00
|
|
|
import EffectComposerBackend
|
2023-06-29 15:06:11 +03:00
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: root
|
|
|
|
|
|
2023-08-15 15:40:46 +03:00
|
|
|
width: 140
|
2023-09-04 14:17:01 +03:00
|
|
|
height: 32
|
2023-06-29 15:06:11 +03:00
|
|
|
|
2023-12-05 16:05:06 +02:00
|
|
|
color: mouseArea.containsMouse && modelData.canBeAdded
|
|
|
|
|
? StudioTheme.Values.themeControlBackgroundInteraction : "transparent"
|
2023-06-29 15:06:11 +03:00
|
|
|
|
2023-08-17 13:41:27 +03:00
|
|
|
signal addEffectNode(var nodeQenPath)
|
|
|
|
|
|
2023-12-05 16:05:06 +02:00
|
|
|
ToolTipArea {
|
2023-06-29 15:06:11 +03:00
|
|
|
id: mouseArea
|
|
|
|
|
|
|
|
|
|
anchors.fill: parent
|
2023-08-15 15:40:46 +03:00
|
|
|
acceptedButtons: Qt.LeftButton
|
2023-06-29 15:06:11 +03:00
|
|
|
|
2024-01-19 12:38:13 +02:00
|
|
|
tooltip: modelData.canBeAdded ? modelData.nodeDescription
|
|
|
|
|
: qsTr("Existing effect has conflicting properties, this effect cannot be added.")
|
2023-12-05 16:05:06 +02:00
|
|
|
|
2023-08-15 15:40:46 +03:00
|
|
|
onClicked: {
|
2023-12-05 16:05:06 +02:00
|
|
|
if (modelData.canBeAdded)
|
|
|
|
|
root.addEffectNode(modelData.nodeQenPath)
|
2023-06-29 15:06:11 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-15 15:40:46 +03:00
|
|
|
Row {
|
|
|
|
|
spacing: 5
|
2024-01-23 15:11:05 +02:00
|
|
|
anchors.fill: parent
|
2023-06-29 15:06:11 +03:00
|
|
|
|
2023-08-15 15:40:46 +03:00
|
|
|
IconImage {
|
|
|
|
|
id: nodeIcon
|
2023-06-29 15:06:11 +03:00
|
|
|
|
2023-09-04 14:17:01 +03:00
|
|
|
width: 32
|
|
|
|
|
height: 32
|
2023-08-15 15:40:46 +03:00
|
|
|
|
2023-12-05 16:05:06 +02:00
|
|
|
color: modelData.canBeAdded ? StudioTheme.Values.themeTextColor
|
|
|
|
|
: StudioTheme.Values.themeTextColorDisabled
|
2023-08-15 15:40:46 +03:00
|
|
|
source: modelData.nodeIcon
|
|
|
|
|
}
|
2023-06-29 15:06:11 +03:00
|
|
|
|
2023-08-15 15:40:46 +03:00
|
|
|
Text {
|
|
|
|
|
text: modelData.nodeName
|
2023-12-05 16:05:06 +02:00
|
|
|
color: modelData.canBeAdded ? StudioTheme.Values.themeTextColor
|
|
|
|
|
: StudioTheme.Values.themeTextColorDisabled
|
2024-01-23 15:11:05 +02:00
|
|
|
|
2023-08-15 15:40:46 +03:00
|
|
|
font.pointSize: StudioTheme.Values.smallFontSize
|
|
|
|
|
anchors.verticalCenter: nodeIcon.verticalCenter
|
2024-01-23 15:11:05 +02:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
width: parent.width - parent.spacing - nodeIcon.width
|
2023-06-29 15:06:11 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|