1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 18:52:30 +01:00

Fix text when using none steam version

Improve style and animation
This commit is contained in:
Elias Steurer 2022-11-02 13:29:27 +01:00
parent 01c458a5f5
commit e7942430eb

View File

@ -3,7 +3,7 @@ import QtQuick.Controls
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
import ScreenPlay import ScreenPlay
import ScreenPlayUtil import ScreenPlayUtil
Item { Item {
id: installedUserHelper id: installedUserHelper
@ -51,9 +51,7 @@ Item {
running: true running: true
loops: Animation.Infinite loops: Animation.Infinite
} }
} }
} }
Image { Image {
@ -69,19 +67,18 @@ Item {
topMargin: -200 topMargin: -200
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
} }
Text { Text {
id: txtHeadline id: txtHeadline
y: 80 y: 80
text: App.settings.steamVersion ? qsTr("Get free Widgets and Wallpaper via the Steam Workshop") : qsTr("Get content via our forum") text: App.settings.steamVersion ? qsTr("Get free Widgets and Wallpaper via the Steam Workshop") : qsTr(
"Get content via our forum")
font.family: App.settings.font font.family: App.settings.font
font.capitalization: Font.Capitalize font.capitalization: Font.Capitalize
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
color: "white" color: "white"
font.weight: Font.Thin
font.pointSize: 28 font.pointSize: 28
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
@ -90,7 +87,6 @@ Item {
left: parent.left left: parent.left
top: parent.top top: parent.top
} }
} }
Image { Image {
@ -106,23 +102,40 @@ Item {
topMargin: 50 topMargin: 50
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
} }
Button { Button {
id: btnWorkshop id: btnWorkshop
text: qsTr("Browse the Steam Workshop") text: {
if (App.settings.steamVersion) {
return qsTr("Browse the Steam Workshop")
} else {
return qsTr("Open the ScreenPlay forum")
}
}
Material.background: Material.color(Material.Orange) Material.background: Material.color(Material.Orange)
Material.foreground: "white" Material.foreground: "white"
font.pointSize: 16 font.pointSize: 16
font.weight: Font.Thin
width: implicitWidth + 20 width: implicitWidth + 20
height: implicitHeight + 10 height: implicitHeight + 10
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_steam.svg" icon.source:{
if (App.settings.steamVersion) {
return "qrc:/qml/ScreenPlayApp/assets/icons/icon_steam.svg"
} else {
return "qrc:/qml/ScreenPlayApp/assets/icons/icon_community.svg"
}
}
icon.width: 18 icon.width: 18
icon.height: 18 icon.height: 18
onClicked: helperButtonPressed(1) onClicked: {
if (App.settings.steamVersion) {
helperButtonPressed(1)
} else {
Qt.openUrlExternally("https://forum.screen-play.app/")
}
}
transform: [ transform: [
Shake { Shake {
id: animShake id: animShake
@ -141,7 +154,6 @@ Item {
bottomMargin: -100 bottomMargin: -100
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
} }
states: [ states: [
@ -173,14 +185,13 @@ Item {
PropertyChanges { PropertyChanges {
target: txtHeadline target: txtHeadline
opacity: 0 opacity: 0
anchors.topMargin: -300 anchors.topMargin: 0
} }
PropertyChanges { PropertyChanges {
target: btnWorkshop target: btnWorkshop
anchors.bottomMargin: -100 anchors.bottomMargin: -100
} }
}, },
State { State {
name: "in" name: "in"
@ -218,7 +229,6 @@ Item {
target: btnWorkshop target: btnWorkshop
anchors.bottomMargin: 50 anchors.bottomMargin: 50
} }
} }
] ]
transitions: [ transitions: [
@ -239,12 +249,11 @@ Item {
property: "opacity" property: "opacity"
duration: 600 duration: 600
} }
} }
SequentialAnimation { SequentialAnimation {
PauseAnimation { PauseAnimation {
duration: 500 duration: 200
} }
PropertyAnimation { PropertyAnimation {
@ -260,29 +269,28 @@ Item {
duration: 600 duration: 600
easing.type: Easing.OutBack easing.type: Easing.OutBack
} }
} }
SequentialAnimation { ParallelAnimation {
PropertyAnimation { PropertyAnimation {
targets: imgLogo targets: imgLogo
property: "opacity" property: "opacity"
duration: 500 duration: 600
easing.type: Easing.InOutExpo easing.type: Easing.InOutExpo
} }
PropertyAnimation { PropertyAnimation {
targets: imgLogo targets: imgLogo
property: "topMargin" property: "topMargin"
duration: 500 duration: 1000
easing.type: Easing.InOutExpo easing.type: Easing.InOutExpo
} }
} }
SequentialAnimation { SequentialAnimation {
PauseAnimation { PauseAnimation {
duration: 200 duration: 400
} }
PropertyAnimation { PropertyAnimation {
@ -291,7 +299,6 @@ Item {
duration: 1100 duration: 1100
easing.type: Easing.InOutExpo easing.type: Easing.InOutExpo
} }
} }
SequentialAnimation { SequentialAnimation {
@ -302,18 +309,16 @@ Item {
PropertyAnimation { PropertyAnimation {
targets: btnWorkshop targets: btnWorkshop
properties: "bottomMargin" properties: "bottomMargin"
duration: 400 duration: 1500
easing.type: Easing.OutBack easing.type: Easing.OutBack
} }
ScriptAction { ScriptAction {
script: { script: {
animShake.start(2000, 1000, -1); animShake.start(2000, 1000, -1)
} }
} }
} }
} }
] ]
} }