From b4d153562b1b7f0dec1e81dd0b3b8fc360f07abf Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Wed, 16 Aug 2023 12:57:41 +0300 Subject: [PATCH] QmlDesigner: Add effect maker main UI buttons and toolbars Also refactor some components into separate files. Fixes: QDS-10409 Change-Id: Ifb6380214b85d9f1d67fbb99269d135234abf1d5 Reviewed-by: Miikka Heikkinen Reviewed-by: Qt CI Patch Build Bot Reviewed-by: --- .../effectMakerQmlSources/EffectMaker.qml | 35 ++++--- .../EffectMakerPreview.qml | 98 ++++++++++++++++++ .../EffectMakerTopBar.qml | 43 ++++++++ .../EffectNodesComboBox.qml | 3 +- .../effectMakerQmlSources/images/qt_logo.png | Bin 0 -> 3663 bytes 5 files changed, 161 insertions(+), 18 deletions(-) create mode 100644 share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMakerPreview.qml create mode 100644 share/qtcreator/qmldesigner/effectMakerQmlSources/EffectMakerTopBar.qml create mode 100644 share/qtcreator/qmldesigner/effectMakerQmlSources/images/qt_logo.png 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 0000000000000000000000000000000000000000..5181f1b5ab43f8536b1c828b2a470a0036389a72 GIT binary patch literal 3663 zcmeAS@N?(olHy`uVBq!ia0y~yU^v0Rz%ZGEje&vTv|!jO1_nMcPZ!6Kid%2zvPXx6 zOC5iHI_I~@>@~A|zeI+2s%_hPB%^21#ZVKsMQT#sC8mbErb)zVCn*b7cj~(77#ub* zIM8tBLUp=?#Dh1L@2w)uy(Q1>e0s5tN(3V-PG+k z!S@NPj6jO2!k^iH#0nf3SP*zZV8fo4#X{#=8BY8^{L%UVBcs3pM#c#j4;V@oI54Di zOnm&kftg9c`EVesyAw>~1Q7+0U;}fL8#~8?28I(C3jQ!c%nbMgGEb_niGkyqjDU!| zLIZPC8^e>-5WNQt3*woZQq(!5m;??mIyy6avU(M^(eP&Q4UzLU+twur-KK1_p_i1mKzE<}~kMFlL599xv$!VxFP3kBR;L-f~ zI?}5C!hAEk^rv%0*C^jQ>5|*__E;KcRgkWh9eTPI<|)vF$bolXZM(F z$-d-|ohD{kqI?Gl+(_>&%C|V?(wRp{R|C_g}Zbz2xXk)c@(zy_~YVS?wxlh+@+uc{{ zw)@Aw$%WUeihF?62itTz}i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