diff --git a/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMaker.qml b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMaker.qml index 4f751883ac9..299f8672329 100644 --- a/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMaker.qml +++ b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMaker.qml @@ -13,37 +13,40 @@ Item { Column { id: col anchors.fill: parent - spacing: 5 + spacing: 1 - Rectangle { - id: topHeader + EffectMakerTopBar { - width: parent.width - height: StudioTheme.Values.toolbarHeight - color: StudioTheme.Values.themeToolbarBackground + } + + EffectMakerPreview { - Row { - // TODO - } } Rectangle { - id: previewHeader - width: parent.width height: StudioTheme.Values.toolbarHeight color: StudioTheme.Values.themeToolbarBackground EffectNodesComboBox { mainRoot: root + + anchors.verticalCenter: parent.verticalCenter + } + + HelperWidgets.AbstractButton { + anchors.right: parent.right + anchors.rightMargin: 5 + anchors.verticalCenter: parent.verticalCenter + + style: StudioTheme.Values.viewBarButtonStyle + buttonIcon: StudioTheme.Constants.code + tooltip: qsTr("Open Shader in Code Editor") + + onClicked: {} // TODO } } - Image { - id: previewImage - - // TODO - } HelperWidgets.ScrollView { id: scrollView diff --git a/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMakerPreview.qml b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMakerPreview.qml new file mode 100644 index 00000000000..a5bc05ed590 --- /dev/null +++ b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMakerPreview.qml @@ -0,0 +1,98 @@ +// 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 QtQuickDesignerTheme +import HelperWidgets as HelperWidgets +import StudioControls as StudioControls +import StudioTheme 1.0 as StudioTheme +import EffectMakerBackend + +Column { + id: root + + width: parent.width + + Rectangle { // toolbar + width: parent.width + height: StudioTheme.Values.toolbarHeight + color: StudioTheme.Values.themeToolbarBackground + + Row { + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + anchors.rightMargin: 5 + spacing: 5 + + HelperWidgets.AbstractButton { + style: StudioTheme.Values.viewBarButtonStyle + buttonIcon: StudioTheme.Constants.zoomOut_medium + tooltip: qsTr("Zoom out") + + onClicked: {} // TODO + } + + HelperWidgets.AbstractButton { + style: StudioTheme.Values.viewBarButtonStyle + buttonIcon: StudioTheme.Constants.zoomIn_medium + tooltip: qsTr("Zoom In") + + onClicked: {} // TODO + } + + HelperWidgets.AbstractButton { + style: StudioTheme.Values.viewBarButtonStyle + buttonIcon: StudioTheme.Constants.cornersAll + tooltip: qsTr("Zoom Fit") + + onClicked: {} // TODO + } + + Column { + Text { + text: "0.000s" + color: StudioTheme.Values.themeTextColor + font.pixelSize: 10 + } + + Text { + text: "0000000" + color: StudioTheme.Values.themeTextColor + font.pixelSize: 10 + } + } + + HelperWidgets.AbstractButton { + style: StudioTheme.Values.viewBarButtonStyle + buttonIcon: StudioTheme.Constants.toStartFrame_medium + tooltip: qsTr("Restart Animation") + + onClicked: {} // TODO + } + + HelperWidgets.AbstractButton { + style: StudioTheme.Values.viewBarButtonStyle + buttonIcon: StudioTheme.Constants.topToolbar_runProject + tooltip: qsTr("Play Animation") + + onClicked: {} // TODO + } + } + } + + Rectangle { // preview image + id: previewImage + + color: "#dddddd" + width: parent.width + height: 200 + + Image { + anchors.margins: 5 + anchors.fill: parent + fillMode: Image.PreserveAspectFit + + source: "images/qt_logo.png" // TODO: update image + } + } +} diff --git a/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMakerTopBar.qml b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMakerTopBar.qml new file mode 100644 index 00000000000..eb5463f3bdf --- /dev/null +++ b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMakerTopBar.qml @@ -0,0 +1,43 @@ +// 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 QtQuickDesignerTheme +import HelperWidgets as HelperWidgets +import StudioControls as StudioControls +import StudioTheme 1.0 as StudioTheme +import EffectMakerBackend + +Rectangle { + id: root + + width: parent.width + height: StudioTheme.Values.toolbarHeight + color: StudioTheme.Values.themeToolbarBackground + + HelperWidgets.Button { + anchors.verticalCenter: parent.verticalCenter + x: 5 + + text: qsTr("Save in Library") + + onClicked: { + // TODO + } + } + + 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 + } +} diff --git a/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectNodesComboBox.qml b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectNodesComboBox.qml index c29449fcf13..3e5a252fb06 100644 --- a/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectNodesComboBox.qml +++ b/share/qtcreator/qmldesigner/effectMakerQmlSources/EffectNodesComboBox.qml @@ -14,7 +14,6 @@ StudioControls.ComboBox { actionIndicatorVisible: false x: 5 width: parent.width - 50 - anchors.verticalCenter: parent.verticalCenter model: [qsTr("+ Add Effect")] @@ -51,7 +50,7 @@ StudioControls.ComboBox { flags: Qt.Popup | Qt.FramelessWindowHint onActiveChanged: { - if (!active) + if (!active && !root.hover) root.popup.close() } diff --git a/share/qtcreator/qmldesigner/effectMakerQmlSources/images/qt_logo.png b/share/qtcreator/qmldesigner/effectMakerQmlSources/images/qt_logo.png new file mode 100644 index 00000000000..5181f1b5ab4 Binary files /dev/null and b/share/qtcreator/qmldesigner/effectMakerQmlSources/images/qt_logo.png differ