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
|
2023-08-29 23:08:43 +03:00
|
|
|
import QtQuick.Layouts
|
2023-08-16 12:57:41 +03:00
|
|
|
import QtQuickDesignerTheme
|
|
|
|
|
import HelperWidgets as HelperWidgets
|
|
|
|
|
import StudioControls as StudioControls
|
|
|
|
|
import StudioTheme 1.0 as StudioTheme
|
|
|
|
|
import EffectMakerBackend
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
|
2023-09-19 14:10:39 +03:00
|
|
|
required property Item mainRoot
|
|
|
|
|
|
2023-10-02 11:33:15 +03:00
|
|
|
property alias source: source
|
|
|
|
|
|
2023-08-16 12:57:41 +03:00
|
|
|
Rectangle { // toolbar
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: StudioTheme.Values.toolbarHeight
|
|
|
|
|
color: StudioTheme.Values.themeToolbarBackground
|
|
|
|
|
|
2023-08-29 23:08:43 +03:00
|
|
|
RowLayout {
|
|
|
|
|
anchors.fill: parent
|
2023-08-16 12:57:41 +03:00
|
|
|
spacing: 5
|
2023-08-29 23:08:43 +03:00
|
|
|
anchors.rightMargin: 5
|
|
|
|
|
anchors.leftMargin: 5
|
|
|
|
|
|
2023-09-19 14:10:39 +03:00
|
|
|
PreviewImagesComboBox {
|
|
|
|
|
id: imagesComboBox
|
|
|
|
|
|
|
|
|
|
mainRoot: root.mainRoot
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-29 23:08:43 +03:00
|
|
|
Item {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
}
|
2023-08-16 12:57:41 +03:00
|
|
|
|
|
|
|
|
HelperWidgets.AbstractButton {
|
2023-10-02 11:33:15 +03:00
|
|
|
enabled: sourceImage.scale > .4
|
2023-08-16 12:57:41 +03:00
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.zoomOut_medium
|
|
|
|
|
tooltip: qsTr("Zoom out")
|
|
|
|
|
|
2023-08-29 23:08:43 +03:00
|
|
|
onClicked: {
|
2023-10-02 11:33:15 +03:00
|
|
|
sourceImage.scale -= .2
|
2023-08-29 23:08:43 +03:00
|
|
|
}
|
2023-08-16 12:57:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HelperWidgets.AbstractButton {
|
2023-10-02 11:33:15 +03:00
|
|
|
enabled: sourceImage.scale < 2
|
2023-08-16 12:57:41 +03:00
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
|
|
|
|
buttonIcon: StudioTheme.Constants.zoomIn_medium
|
|
|
|
|
tooltip: qsTr("Zoom In")
|
|
|
|
|
|
2023-08-29 23:08:43 +03:00
|
|
|
onClicked: {
|
2023-10-02 11:33:15 +03:00
|
|
|
sourceImage.scale += .2
|
2023-08-29 23:08:43 +03:00
|
|
|
}
|
2023-08-16 12:57:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HelperWidgets.AbstractButton {
|
2023-10-02 11:33:15 +03:00
|
|
|
enabled: sourceImage.scale !== 1
|
2023-08-16 12:57:41 +03:00
|
|
|
style: StudioTheme.Values.viewBarButtonStyle
|
2023-09-05 18:03:05 +03:00
|
|
|
buttonIcon: StudioTheme.Constants.fitAll_medium
|
2023-08-16 12:57:41 +03:00
|
|
|
tooltip: qsTr("Zoom Fit")
|
|
|
|
|
|
2023-08-29 23:08:43 +03:00
|
|
|
onClicked: {
|
2023-10-02 11:33:15 +03:00
|
|
|
sourceImage.scale = 1
|
2023-08-29 23:08:43 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
Layout.fillWidth: true
|
2023-08-16 12:57:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
2023-10-02 11:33:15 +03:00
|
|
|
id: preview
|
2023-08-16 12:57:41 +03:00
|
|
|
|
|
|
|
|
color: "#dddddd"
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: 200
|
2023-08-29 23:08:43 +03:00
|
|
|
clip: true
|
2023-08-16 12:57:41 +03:00
|
|
|
|
2023-10-02 11:33:15 +03:00
|
|
|
Item {
|
|
|
|
|
id: source
|
2023-08-16 12:57:41 +03:00
|
|
|
anchors.fill: parent
|
2023-10-02 11:33:15 +03:00
|
|
|
layer.enabled: true
|
|
|
|
|
layer.mipmap: true
|
|
|
|
|
layer.smooth: true
|
|
|
|
|
|
|
|
|
|
Image {
|
|
|
|
|
id: sourceImage
|
|
|
|
|
anchors.margins: 5
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
|
source: imagesComboBox.selectedImage
|
|
|
|
|
smooth: true
|
|
|
|
|
|
|
|
|
|
Behavior on scale {
|
|
|
|
|
NumberAnimation {
|
|
|
|
|
duration: 200
|
|
|
|
|
easing.type: Easing.OutQuad
|
|
|
|
|
}
|
2023-08-29 23:08:43 +03:00
|
|
|
}
|
|
|
|
|
}
|
2023-08-16 12:57:41 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|