1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Change layout and add new animations

This commit is contained in:
kelteseth 2017-10-16 18:03:06 +02:00
parent 0f23be2a90
commit eaefda3615
2 changed files with 164 additions and 62 deletions

View File

@ -43,7 +43,12 @@ CustomPage {
CreateLeftArea {
id: leftArea
width: parent.width * .5
width: parent.width * .35
radius: 4
border.width: 2
border.color: "#c2c2c2"
anchors.leftMargin: 30
anchors.topMargin: 30
anchors {
top: parent.top
left: parent.left
@ -54,7 +59,7 @@ CustomPage {
Item {
id: rightArea
width: parent.width * .4
width: parent.width * .58
anchors {
top: parent.top
right: parent.right
@ -63,14 +68,14 @@ CustomPage {
}
Item {
id: rightTop
height: 150
height: 200
anchors {
top: parent.top
right: parent.right
left: parent.left
}
Item {
width: parent.width * .46
width: parent.width * .48
height: parent.height
FileDropperSingleFile {
id:fileDropperVideo
@ -83,7 +88,7 @@ CustomPage {
}
}
Item {
width: parent.width * .46
width: parent.width * .48
anchors.right: parent.right
height: parent.height
@ -126,4 +131,32 @@ CustomPage {
}
}
}
Rectangle {
id: rectangle
color: "#e6ffffff"
enabled: false
opacity: 0
anchors.fill: parent
}
states: [
State {
name: "createLocalWallpaper"
PropertyChanges {
target: rectangle
enabled: true
opacity: 1
}
}
]
transitions: [
Transition {
from: "*"
to: "*"
PropertyAnimation{
properties: "opacity"; easing.type: Easing.InOutQuad
}
}
]
}

View File

@ -7,7 +7,7 @@ import Qt.labs.platform 1.0
Rectangle {
id: leftArea
radius: 3
height: column.childrenRect.height + (6 * 30)
height: column.childrenRect.height + 200
state: "workshop"
property int steamWorkshopHeight
property url videoPath
@ -18,10 +18,9 @@ Rectangle {
Row {
id: rowUseSteamWorkshop
height: 40
anchors.horizontalCenter: parent.horizontalCenter
anchors {
top: parent.top
right: parent.right
left: parent.left
margins: 30
}
@ -39,8 +38,10 @@ Rectangle {
Text {
id: txtUseSteamWorkshop
text: qsTr("Upload Wallpaper to Steam Workshop")
color: "#626262"
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.top: parent.top
anchors.topMargin: 0
verticalAlignment: Text.AlignVCenter
@ -58,20 +59,21 @@ Rectangle {
left: parent.left
margins: 30
}
spacing: 30
spacing: 0
TextField {
id: txtTitle
width: parent.width
height: 60
selectByMouse: true
text: qsTr("")
placeholderText: "Title"
}
Column {
spacing: 30
spacing: 10
id: useSteamWorkshopFieldsWrapper
height: 300
height: 270
anchors {
right: parent.right
left: parent.left
@ -80,6 +82,7 @@ Rectangle {
TextField {
id: txtDescription
width: parent.width
selectByMouse: true
height: 60
text: qsTr("")
placeholderText: "Description"
@ -95,6 +98,7 @@ Rectangle {
TextField {
id: txtYouTube
width: parent.width
selectByMouse: true
height: 60
text: qsTr("")
placeholderText: "YouTube Preview"
@ -120,51 +124,60 @@ Rectangle {
spacing: 30
}
}
}
Button {
id: btnSubmit
anchors {
left: parent.left
bottom: parent.bottom
margins: 30
}
Button {
id: btnSubmit
text: qsTr("Create New Workshop Wallpaper")
onClicked: {
text: qsTr("Create New Workshop Wallpaper")
onClicked: {
//Check for empty fields
if (videoPath.toString() === "") {
hasEmptyField(0)
} else if (previewPath.toString() === "") {
hasEmptyField(1)
//Check for empty fields
if (videoPath.toString() === "") {
hasEmptyField(0)
} else if (previewPath.toString() === "") {
hasEmptyField(1)
} else if (txtTitle.text === "") {
txtTitle.select(0, 0)
} else {
//Check if whether to use steamWorkshop or not
if (switchUseSteamWorkshop.checked) {
//TODO wait for callback
steamWorkshop.createWorkshopItem()
steamWorkshop.submitWorkshopItem(
txtTitle.text.toString(),
txtDescription.text.toString(), "english",
cbVisibility.currentIndex, videoPath,
previewPath)
tiItemUpdate.start()
} else {
//Check if whether to use steamWorkshop or not
if (switchUseSteamWorkshop.checked) {
//TODO wait for callback
steamWorkshop.createWorkshopItem()
steamWorkshop.submitWorkshopItem(
txtTitle.text.toString(),
txtDescription.text.toString(), "english",
cbVisibility.currentIndex,
fileDialogOpenVideo.currentFile,
fileDialogOpenPreview.currentFile)
tiItemUpdate.start()
} else {
steamWorkshop.createLocalWorkshopItem(
txtTitle.text.toString(),
fileDialogOpenVideo.currentFile,
fileDialogOpenPreview.currentFile)
}
steamWorkshop.createLocalWorkshopItem(
txtTitle.text.toString(), videoPath,
previewPath)
}
}
}
CheckDelegate {
id: checkDelegate
opacity: 0
visible: false
text: qsTr("By submitting this item, you agree to the workshop terms of service")
onCheckedChanged: {
if (checkDelegate.visible) {
Qt.openUrlExternally(
"http://steamcommunity.com/sharedfiles/workshoplegalagreement")
}
}
CheckDelegate {
id: checkDelegate
opacity: 0
visible: false
text: qsTr("By submitting this item, you agree to the workshop terms of service")
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
onCheckedChanged: {
if (checkDelegate.visible) {
Qt.openUrlExternally(
"http://steamcommunity.com/sharedfiles/workshoplegalagreement")
}
}
}
@ -179,19 +192,41 @@ Rectangle {
}
PropertyChanges {
target: txtUseSteamWorkshop
color: "black"
color: "#626262"
}
PropertyChanges {
target: btnSubmit
text: qsTr("Create Local Wallpaper")
}
PropertyChanges {
target: txtDescription
opacity: 0
}
PropertyChanges {
target: txtTags
opacity: 0
}
PropertyChanges {
target: txtYouTube
opacity: 0
}
PropertyChanges {
target: rowVisible
opacity: 0
}
},
State {
name: "workshop"
PropertyChanges {
target: useSteamWorkshopFieldsWrapper
visible: true
height: 200
height: 270
}
PropertyChanges {
target: txtUseSteamWorkshop
@ -201,27 +236,61 @@ Rectangle {
target: btnSubmit
text: qsTr("Upload Wallpaper to Steam Workshop")
}
PropertyChanges {
target: txtDescription
opacity: 1
}
PropertyChanges {
target: txtTags
opacity: 1
}
PropertyChanges {
target: txtYouTube
opacity: 1
}
PropertyChanges {
target: rowVisible
opacity: 1
}
}
]
transitions: [
Transition {
from: "local"
to: "workshop"
from: "*"
to: "*"
PropertyAnimation {
property: "height"
duration: 300
duration: 250
easing.type: Easing.InOutQuad
}
},
Transition {
from: "workshop"
to: "local"
PropertyAnimation {
property: "height"
duration: 200
easing.type: Easing.InOutQuad
SequentialAnimation {
PropertyAnimation {
target: txtDescription
property: "opacity"
duration: 100
}
PropertyAnimation {
target: txtTags
property: "opacity"
duration: 100
}
PropertyAnimation {
target: txtYouTube
property: "opacity"
duration: 100
}
PropertyAnimation {
target: rowVisible
property: "opacity"
duration: 100
}
}
}
]