2023-08-16 12:57:41 +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 HelperWidgets as HelperWidgets
|
|
|
|
|
import StudioControls as StudioControls
|
2024-01-16 12:30:29 +01:00
|
|
|
import StudioTheme as StudioTheme
|
2023-08-16 12:57:41 +03:00
|
|
|
import EffectMakerBackend
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
height: StudioTheme.Values.toolbarHeight
|
|
|
|
|
color: StudioTheme.Values.themeToolbarBackground
|
|
|
|
|
|
2023-12-08 14:58:04 +02:00
|
|
|
signal addClicked
|
2023-10-19 19:21:31 +03:00
|
|
|
signal saveClicked
|
2023-12-13 12:11:06 +02:00
|
|
|
signal saveAsClicked
|
2023-12-13 15:54:57 +02:00
|
|
|
signal assignToSelectedClicked
|
2023-10-19 19:21:31 +03:00
|
|
|
|
2023-12-13 12:11:06 +02:00
|
|
|
Row {
|
|
|
|
|
spacing: 5
|
2023-08-16 12:57:41 +03:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2023-12-08 14:58:04 +02:00
|
|
|
|
2023-12-13 12:11:06 +02:00
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.add_medium
|
|
|
|
|
tooltip: qsTr("Add new composition")
|
2023-08-16 12:57:41 +03:00
|
|
|
|
2023-12-13 12:11:06 +02:00
|
|
|
onClicked: root.addClicked()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.save_medium
|
|
|
|
|
tooltip: qsTr("Save current composition")
|
|
|
|
|
enabled: EffectMakerBackend.effectMakerModel.hasUnsavedChanges
|
|
|
|
|
|| EffectMakerBackend.effectMakerModel.currentComposition === ""
|
|
|
|
|
|
|
|
|
|
onClicked: root.saveClicked()
|
|
|
|
|
}
|
2023-08-16 12:57:41 +03:00
|
|
|
|
2023-12-13 12:11:06 +02:00
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.saveAs_medium
|
|
|
|
|
tooltip: qsTr("Save current composition with a new name")
|
|
|
|
|
enabled: !EffectMakerBackend.effectMakerModel.isEmpty
|
|
|
|
|
|
|
|
|
|
onClicked: root.saveAsClicked()
|
|
|
|
|
}
|
2023-12-13 15:54:57 +02:00
|
|
|
|
|
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.assignTo_medium
|
|
|
|
|
tooltip: qsTr("Assign current composition to selected item")
|
|
|
|
|
enabled: EffectMakerBackend.effectMakerModel.currentComposition !== ""
|
|
|
|
|
|
|
|
|
|
onClicked: root.assignToSelectedClicked()
|
|
|
|
|
}
|
2023-08-16 12:57:41 +03:00
|
|
|
}
|
|
|
|
|
|
2023-12-13 12:11:06 +02:00
|
|
|
|
2023-12-07 18:16:19 +02:00
|
|
|
Text {
|
|
|
|
|
readonly property string compName: EffectMakerBackend.effectMakerModel.currentComposition
|
|
|
|
|
|
|
|
|
|
text: compName !== "" ? compName : qsTr("Untitled")
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
color: StudioTheme.Values.themeTextColor
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-16 12:57:41 +03:00
|
|
|
HelperWidgets.AbstractButton {
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
anchors.rightMargin: 5
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.help
|
|
|
|
|
tooltip: qsTr("How to use Effect Maker:
|
|
|
|
|
1. Click \"+ Add Effect\" to add effect node
|
|
|
|
|
2. Adjust the effect nodes properties
|
|
|
|
|
3. Change the order of the effects, if you like
|
|
|
|
|
4. See the preview
|
|
|
|
|
5. Save in the library, if you wish to reuse the effect later") // TODO: revise with doc engineer
|
2024-01-22 17:38:40 +02:00
|
|
|
|
|
|
|
|
onClicked: Qt.openUrlExternally("https://doc.qt.io/qtdesignstudio/qt-using-effect-maker-effects.html")
|
2023-08-16 12:57:41 +03:00
|
|
|
}
|
|
|
|
|
}
|