mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
Add new create dialog
This commit is contained in:
parent
5368688acd
commit
1330828fe1
@ -106,5 +106,6 @@
|
||||
<file>assets/icons/icon_emptyWidget.svg</file>
|
||||
<file>translations/ScreenPlay_de.qm</file>
|
||||
<file>translations/ScreenPlay_en.qm</file>
|
||||
<file>qml/Create/CreateNew.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -26,7 +26,7 @@ Rectangle {
|
||||
file: videoFile
|
||||
})
|
||||
}
|
||||
onProjectFileSelected:{
|
||||
onProjectFileSelected: {
|
||||
create.state = "import"
|
||||
|
||||
activeFolder = projectFile
|
||||
@ -109,14 +109,14 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
|
||||
MouseArea {
|
||||
id:ma
|
||||
id: ma
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onPressed: {
|
||||
attractor.enabled = true
|
||||
}
|
||||
onPositionChanged: {
|
||||
if(ma.pressed){
|
||||
if (ma.pressed) {
|
||||
attractor.pointX = mouseX
|
||||
attractor.pointY = mouseY
|
||||
}
|
||||
@ -127,14 +127,13 @@ Rectangle {
|
||||
}
|
||||
|
||||
Attractor {
|
||||
id:attractor
|
||||
id: attractor
|
||||
system: particleSystem
|
||||
affectedParameter: Attractor.Acceleration
|
||||
strength: 8000000
|
||||
proportionalToDistance: Attractor.InverseQuadratic
|
||||
}
|
||||
|
||||
|
||||
ParticleSystem {
|
||||
id: particleSystem
|
||||
}
|
||||
@ -234,6 +233,12 @@ Rectangle {
|
||||
right: spaceBar.left
|
||||
rightMargin: 50
|
||||
}
|
||||
onButtonPressed: {
|
||||
create.state = "new"
|
||||
loader.setSource("CreateNew.qml", {
|
||||
project: type
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
@ -267,30 +272,33 @@ Rectangle {
|
||||
Material.background: Material.Orange
|
||||
Material.foreground: "white"
|
||||
icon.source: "qrc:/assets/icons/icon_info.svg"
|
||||
icon.color:"white"
|
||||
icon.color: "white"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
onClicked: Qt.openUrlExternally("http://qmlbook.github.io/en/ch04/index.html#qml-syntax")
|
||||
onClicked: Qt.openUrlExternally(
|
||||
"http://qmlbook.github.io/en/ch04/index.html#qml-syntax")
|
||||
}
|
||||
Button {
|
||||
text: qsTr("Documentation")
|
||||
Material.background: Material.LightGreen
|
||||
Material.foreground: "white"
|
||||
icon.source: "qrc:/assets/icons/icon_document.svg"
|
||||
icon.color:"white"
|
||||
icon.color: "white"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
onClicked: Qt.openUrlExternally("https://qmlbook.github.io/index.html")
|
||||
onClicked: Qt.openUrlExternally(
|
||||
"https://qmlbook.github.io/index.html")
|
||||
}
|
||||
Button {
|
||||
text: qsTr("Forums")
|
||||
Material.background: Material.Blue
|
||||
Material.foreground: "white"
|
||||
icon.source: "qrc:/assets/icons/icon_people.svg"
|
||||
icon.color:"white"
|
||||
icon.color: "white"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
onClicked: Qt.openUrlExternally("https://forum.screen-play.rocks/")
|
||||
onClicked: Qt.openUrlExternally(
|
||||
"https://forum.screen-play.rocks/")
|
||||
}
|
||||
Button {
|
||||
text: qsTr("Workshop")
|
||||
@ -307,8 +315,6 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "out"
|
||||
@ -336,6 +342,26 @@ Rectangle {
|
||||
State {
|
||||
name: "import"
|
||||
|
||||
PropertyChanges {
|
||||
target: createWallpaper
|
||||
state: "out"
|
||||
}
|
||||
PropertyChanges {
|
||||
target: createWidget
|
||||
state: "out"
|
||||
}
|
||||
PropertyChanges {
|
||||
target: spaceBar
|
||||
opacity: 0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: txtDescriptionBottom
|
||||
opacity: 0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "new"
|
||||
|
||||
PropertyChanges {
|
||||
target: createWallpaper
|
||||
state: "out"
|
||||
@ -366,11 +392,9 @@ Rectangle {
|
||||
duration: 200
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
ParallelAnimation {
|
||||
|
||||
PauseAnimation {
|
||||
duration: 200
|
||||
}
|
||||
PauseAnimation {
|
||||
duration: 200
|
||||
}
|
||||
|
||||
NumberAnimation {
|
||||
|
273
ScreenPlay/qml/Create/CreateNew.qml
Normal file
273
ScreenPlay/qml/Create/CreateNew.qml
Normal file
@ -0,0 +1,273 @@
|
||||
import QtQuick 2.9
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Controls.Material 2.2
|
||||
import Qt.labs.platform 1.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
Item {
|
||||
id: createNew
|
||||
anchors.fill: parent
|
||||
state: "out"
|
||||
property string project
|
||||
Component.onCompleted: createNew.state = "in"
|
||||
|
||||
RectangularGlow {
|
||||
id: effect
|
||||
anchors {
|
||||
top: wrapper.top
|
||||
left: wrapper.left
|
||||
right: wrapper.right
|
||||
topMargin: 3
|
||||
}
|
||||
|
||||
height: wrapper.height
|
||||
width: wrapper.width
|
||||
cached: true
|
||||
glowRadius: 3
|
||||
spread: 0.2
|
||||
color: "black"
|
||||
opacity: 0.4
|
||||
cornerRadius: 15
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: wrapper
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: parent.top
|
||||
}
|
||||
|
||||
width: 510
|
||||
radius: 4
|
||||
height: 560
|
||||
|
||||
ColumnLayout {
|
||||
anchors {
|
||||
top: parent.top
|
||||
margins: 20
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right:parent.right
|
||||
}
|
||||
spacing: 50
|
||||
|
||||
Rectangle {
|
||||
radius: 4
|
||||
color: "gray"
|
||||
width: 300
|
||||
height: 180
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: txtTitle
|
||||
height: 60
|
||||
anchors {
|
||||
right:parent.right
|
||||
left:parent.left
|
||||
}
|
||||
|
||||
|
||||
selectByMouse: true
|
||||
text: qsTr("")
|
||||
placeholderText: "Project Name"
|
||||
onTextChanged: {
|
||||
txtPath.text = folderDialog.currentFolder + "/" +txtTitle.text
|
||||
}
|
||||
}
|
||||
Item {
|
||||
height: 60
|
||||
width: parent.width
|
||||
|
||||
Text {
|
||||
id: txtPath
|
||||
text: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0]
|
||||
color: "#5D5D5D"
|
||||
font.pixelSize: 16
|
||||
font.family: "Roboto"
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
wrapMode: Text.WrapAnywhere
|
||||
clip: true
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
right: btnFolder.left
|
||||
rightMargin: 30
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: btnFolder
|
||||
text: qsTr("Set Folder")
|
||||
Material.background: Material.Orange
|
||||
Material.foreground: "white"
|
||||
icon.source: "qrc:/assets/icons/icon_plus.svg"
|
||||
icon.color: "white"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
anchors {
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
|
||||
folderDialog.open()
|
||||
}
|
||||
FolderDialog {
|
||||
id: folderDialog
|
||||
folder:StandardPaths.standardLocations(StandardPaths.HomeLocation)[0]
|
||||
onAccepted: {
|
||||
txtPath.text = folderDialog.currentFolder + "/" +txtTitle.text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: qsTr("Create")
|
||||
Material.background: Material.Orange
|
||||
Material.foreground: "white"
|
||||
icon.source: "qrc:/assets/icons/icon_info.svg"
|
||||
icon.color: "white"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
onClicked: {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
MouseArea {
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
margins: 5
|
||||
}
|
||||
width: 32
|
||||
height: width
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: createNew.state = "out"
|
||||
|
||||
Image {
|
||||
id: imgClose
|
||||
source: "qrc:/assets/icons/font-awsome/close.svg"
|
||||
width: 16
|
||||
height: 16
|
||||
anchors.centerIn: parent
|
||||
sourceSize: Qt.size(width, width)
|
||||
}
|
||||
ColorOverlay {
|
||||
id: iconColorOverlay
|
||||
anchors.fill: imgClose
|
||||
source: imgClose
|
||||
color: "gray"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "out"
|
||||
PropertyChanges {
|
||||
target: wrapper
|
||||
anchors.topMargin: 800
|
||||
opacity: 0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: effect
|
||||
opacity: 0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "in"
|
||||
PropertyChanges {
|
||||
target: wrapper
|
||||
anchors.topMargin: 40
|
||||
opacity: 1
|
||||
}
|
||||
PropertyChanges {
|
||||
target: effect
|
||||
opacity: .4
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "out"
|
||||
to: "in"
|
||||
SequentialAnimation {
|
||||
|
||||
PauseAnimation {
|
||||
duration: 400
|
||||
}
|
||||
ParallelAnimation {
|
||||
|
||||
PropertyAnimation {
|
||||
target: wrapper
|
||||
duration: 600
|
||||
property: "anchors.topMargin"
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: wrapper
|
||||
duration: 600
|
||||
property: "opacity"
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
SequentialAnimation {
|
||||
|
||||
PauseAnimation {
|
||||
duration: 1000
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: effect
|
||||
duration: 300
|
||||
property: "opacity"
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
Transition {
|
||||
from: "in"
|
||||
to: "out"
|
||||
|
||||
ParallelAnimation {
|
||||
|
||||
PropertyAnimation {
|
||||
target: wrapper
|
||||
duration: 600
|
||||
property: "anchors.topMargin"
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: wrapper
|
||||
duration: 600
|
||||
property: "opacity"
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
SequentialAnimation {
|
||||
|
||||
PauseAnimation {
|
||||
duration: 500
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: effect
|
||||
duration: 300
|
||||
property: "opacity"
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -6,6 +6,8 @@ Item {
|
||||
state: "out"
|
||||
Component.onCompleted: state = "in"
|
||||
|
||||
signal buttonPressed(var type)
|
||||
|
||||
Text {
|
||||
id: txtCreate
|
||||
text: qsTr("Create Widgets and Scenes")
|
||||
@ -28,7 +30,9 @@ Item {
|
||||
anchors.topMargin: 20
|
||||
imgSource: "qrc:/assets/icons/icon_emptyWidget.svg"
|
||||
onClicked: {
|
||||
folderDialog.open()
|
||||
|
||||
buttonPressed("empty")
|
||||
//folderDialog.open()
|
||||
}
|
||||
FolderDialog {
|
||||
id: folderDialog
|
||||
@ -40,7 +44,7 @@ Item {
|
||||
}
|
||||
Text {
|
||||
id: txtExamples
|
||||
text: qsTr("Examples Widgets")
|
||||
text: qsTr("Examples Widgets and Scenes")
|
||||
font.family: "Roboto"
|
||||
renderType: Text.NativeRendering
|
||||
font.pixelSize: 18
|
||||
@ -66,6 +70,7 @@ Item {
|
||||
buttonActive: true
|
||||
imgSource: "qrc:/assets/icons/icon_time.svg"
|
||||
onClicked: {
|
||||
buttonPressed("clock")
|
||||
|
||||
}
|
||||
}
|
||||
@ -75,7 +80,7 @@ Item {
|
||||
buttonActive: true
|
||||
imgSource: "qrc:/assets/icons/icon_library_music.svg"
|
||||
onClicked: {
|
||||
|
||||
buttonPressed("music")
|
||||
}
|
||||
}
|
||||
CreateWidgetButton {
|
||||
@ -84,7 +89,7 @@ Item {
|
||||
imgSource: "qrc:/assets/icons/icon_scene.svg"
|
||||
buttonActive: true
|
||||
onClicked: {
|
||||
|
||||
buttonPressed("slideshow")
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user