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

Replace pixelSize with device dpi independent pointSize

This commit is contained in:
Elias 2019-03-28 20:09:55 +01:00
parent 0352a88e02
commit cea7d0b214
26 changed files with 51 additions and 511 deletions

View File

@ -79,8 +79,6 @@
<file>qml/Community/Feedback.qml</file> <file>qml/Community/Feedback.qml</file>
<file>qml/Controls/Slider.qml</file> <file>qml/Controls/Slider.qml</file>
<file>qml/Create/Create.qml</file> <file>qml/Create/Create.qml</file>
<file>qml/Create/CreateImport.qml</file>
<file>qml/Create/CreateImportStatus.qml</file>
<file>qml/Create/CreateNew.qml</file> <file>qml/Create/CreateNew.qml</file>
<file>qml/Create/CreateUpload.qml</file> <file>qml/Create/CreateUpload.qml</file>
<file>qml/Create/CreateWallpaper.qml</file> <file>qml/Create/CreateWallpaper.qml</file>

View File

@ -61,7 +61,7 @@ GridView {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
font.pixelSize: 32 font.pointSize: 32
font.family: "Roboto" font.family: "Roboto"
anchors { anchors {
@ -140,7 +140,7 @@ GridView {
color: "white" color: "white"
font.family: "Roboto" font.family: "Roboto"
font.weight: Font.Normal font.weight: Font.Normal
font.pixelSize: 18 font.pointSize: 18
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
Text { Text {
@ -160,7 +160,7 @@ GridView {
font.family: "Roboto" font.family: "Roboto"
font.weight: Font.Normal font.weight: Font.Normal
font.pixelSize: 14 font.pointSize: 14
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
MouseArea { MouseArea {

View File

@ -18,7 +18,7 @@ Item {
id: txtHeadline id: txtHeadline
text: headline text: headline
height: 20 height: 20
font.pixelSize: 14 font.pointSize: 14
font.family: "Roboto" font.family: "Roboto"
color: "#5D5D5D" color: "#5D5D5D"

View File

@ -196,7 +196,7 @@ Item {
text: qsTr("Create wallpapers and widgets for local usage or the steam workshop!") text: qsTr("Create wallpapers and widgets for local usage or the steam workshop!")
font.family: "Roboto" font.family: "Roboto"
font.pixelSize: 14 font.pointSize: 10
color: "white" color: "white"
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter

View File

@ -1,272 +0,0 @@
import QtQuick 2.12
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.3
import Qt.labs.platform 1.0
import QtQuick.Controls.Material 2.2
Item {
id: createImport
anchors.fill: parent
state: "out"
Component.onCompleted: state = "in"
property bool isVideoPlaying: true
property url file
onFileChanged: {
}
RectangularGlow {
id: effect
anchors {
top: videoOutWrapper.top
left: videoOutWrapper.left
right: videoOutWrapper.right
topMargin: 3
}
height: videoOutWrapper.height
width: videoOutWrapper.width
cached: true
z: 9
glowRadius: 3
spread: 0.2
color: "black"
opacity: 0.4
cornerRadius: 15
}
Rectangle {
id: videoOutWrapper
width: 450
height: 263
z: 12
color: "black"
anchors {
top: parent.top
topMargin: 180
horizontalCenter: parent.horizontalCenter
}
}
RectangularGlow {
id: effect2
anchors {
top: contentWrapper.top
left: contentWrapper.left
right: contentWrapper.right
topMargin: 3
}
height: contentWrapper.height
width: contentWrapper.width
cached: true
z: 9
glowRadius: 3
spread: 0.2
color: "black"
opacity: 0.4
cornerRadius: 15
}
Rectangle {
id: contentWrapper
width: 800
height: 300
z: 10
radius: 4
anchors {
top: parent.top
topMargin: 300
horizontalCenter: parent.horizontalCenter
}
Item {
id: chooseImageWrapper
height: 60
anchors {
top: parent.top
topMargin: 50
right: parent.right
left: parent.left
}
FileDialog {
id: fileDialogOpenPreview
nameFilters: ["Image files (*.jpg *.png)"]
onAccepted: {
imgPreview.source = currentFile
imgPreview.opacity = 1
//currentFile
}
}
Button {
id: btnChooseImage
text: qsTr("Select Image Manually")
Material.background: Material.Orange
Material.foreground: "white"
icon.source: "qrc:/assets/icons/icon_folder_open.svg"
icon.color: "white"
icon.width: 16
icon.height: 16
anchors.centerIn: parent
onClicked: fileDialogOpenPreview.open()
}
}
Column {
spacing: 20
anchors {
top: chooseImageWrapper.top
topMargin: 50
right: parent.right
rightMargin: 78
bottom: parent.bottom
bottomMargin: 50
left: parent.left
leftMargin: 78
}
TextField {
id: txtTitle
height: 60
width: parent.width
selectByMouse: true
text: qsTr("Title")
placeholderText: "Title"
}
}
Button {
text: qsTr("Import Video")
Material.background: Material.Orange
Material.foreground: "white"
icon.source: "qrc:/assets/icons/icon_upload.svg"
icon.color: "white"
icon.width: 16
icon.height: 16
anchors {
bottom: parent.bottom
bottomMargin: 10
horizontalCenter: parent.horizontalCenter
}
onClicked: {
if (txtTitle.text === ""
|| txtTitle.placeholderText === "Text") {
txtTitle.select(0, 0)
txtTitle.focus = true
return
}
//Check if there are any other characters than space
if (!(/\S/.test(txtTitle.text))) {
txtTitle.select(0, 0)
txtTitle.focus = true
return
}
if (fileDialogOpenPreview.currentFile != "") {
screenPlayCreate.importVideo(
txtTitle.text.replace(/\s/g, ''), file,
fileDialogOpenPreview.currentFile,
player.duration)
} else {
screenPlayCreate.importVideo(
txtTitle.text.replace(/\s/g, ''), file,
player.position,
player.duration,
player.metaData.videoFrameRate)
}
player.stop()
createImport.state = "out"
}
}
}
states: [
State {
name: "out"
PropertyChanges {
target: createImport
opacity: 0
}
PropertyChanges {
target: videoOutWrapper
z: 0
opacity: 0
anchors.topMargin: 50
}
PropertyChanges {
target: effect
opacity: 0
color: "transparent"
}
PropertyChanges {
target: contentWrapper
anchors.topMargin: -500
opacity: 0
}
},
State {
name: "in"
PropertyChanges {
target: createImport
opacity: 1
}
PropertyChanges {
target: contentWrapper
opacity: 1
anchors.topMargin: 300
}
PropertyChanges {
target: videoOutWrapper
z: 12
opacity: 1
anchors.topMargin: 70
}
}
]
transitions: [
Transition {
from: "out"
to: "in"
reversible: true
SequentialAnimation {
PauseAnimation {
duration: 500
}
ParallelAnimation {
PropertyAnimation {
duration: 300
target: contentWrapper
property: "opacity"
}
PropertyAnimation {
duration: 300
target: contentWrapper
property: "anchors.topMargin"
easing.type: Easing.OutQuart
}
}
ParallelAnimation {
PropertyAnimation {
duration: 250
target: videoOutWrapper
property: "opacity"
}
PropertyAnimation {
duration: 250
target: effect
properties: "color, opacity"
}
}
}
}
]
}

View File

@ -1,186 +0,0 @@
import QtQuick 2.12
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.3
// Qt Creator does not support Namespaced enums yet
// https://bugreports.qt.io/browse/QTCREATORBUG-17850
import LocalWorkshopCreationStatus 1.0
Item {
id: createImportStatus
anchors.fill: parent
state: "out"
signal backToCreate
signal uploadToSteamWorkshop()
Timer {
repeat: false
running: true
interval: 300
onTriggered: {
createImportStatus.state = "in"
}
}
Connections {
target: screenPlayCreate
onLocalWorkshopCreationStatusChanged: {
switch (status) {
case LocalWorkshopCreationStatus.Started:
txtStatus.text = "Copy video started"
break
case LocalWorkshopCreationStatus.CopyVideoFinished:
txtStatus.text = "Copy Video Finished"
break
case LocalWorkshopCreationStatus.CopyImageFinished:
txtStatus.text = "Copy Image Finished"
break
case LocalWorkshopCreationStatus.CopyConfigFinished:
txtStatus.text = "Copy Config Finished"
break
case LocalWorkshopCreationStatus.ErrorCopyConfig:
txtStatus.text = "Error Copy Config!"
break
case LocalWorkshopCreationStatus.Finished:
txtStatus.text = "Success!"
busyIndicator.running = false
break
default:
break
}
}
}
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
width: 800
height: 400
radius: 4
anchors {
top: parent.top
topMargin: 100
horizontalCenter: parent.horizontalCenter
}
Text {
id: txtStatus
height: 80
font.family: "Roboto"
font.pixelSize: 24
color: "gray"
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
anchors {
top: busyIndicator.bottom
topMargin: 10
horizontalCenter: parent.horizontalCenter
}
}
BusyIndicator {
id: busyIndicator
running: true
anchors {
top: parent.top
topMargin: 100
horizontalCenter: parent.horizontalCenter
}
}
Row {
id: item1
width: 450
height: 49
spacing: 10
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
Button {
id: button
text: qsTr("Create another Wallpaper")
onClicked: {
backToCreate()
createImportStatus.state = "out"
}
}
Button {
id: button2
text: qsTr("Upload Wallpaper to Steam")
onClicked: {
uploadToSteamWorkshop()
createImportStatus.state = "in"
}
}
}
}
states: [
State {
name: "out"
PropertyChanges {
target: wrapper
anchors.topMargin: 500
opacity: 0
}
PropertyChanges {
target: effect
color: "transparent"
opacity: 0
}
},
State {
name: "in"
PropertyChanges {
target: wrapper
anchors.topMargin: 100
opacity: 1
}
PropertyChanges {
target: effect
color: "black"
opacity: 0.4
}
}
]
transitions: [
Transition {
from: "out"
to: "in"
reversible: true
SequentialAnimation {
NumberAnimation {
target: wrapper
properties: "opacity, anchors.topMargin"
duration: 200
easing.type: Easing.OutQuart
}
NumberAnimation {
target: effect
properties: "opacity, color"
duration: 200
easing.type: Easing.OutQuart
}
}
}
]
}

View File

@ -305,7 +305,7 @@ Item {
Text { Text {
id: txtUploadSize id: txtUploadSize
color: "gray" color: "gray"
font.pixelSize: 16 font.pointSize: 14
height: 30 height: 30
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
@ -319,7 +319,7 @@ Item {
id: txtUploadStatus id: txtUploadStatus
text: qsTr("Creating Workshop Item") text: qsTr("Creating Workshop Item")
color: "gray" color: "gray"
font.pixelSize: 16 font.pointSize: 12
height: 30 height: 30
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter

View File

@ -28,7 +28,7 @@ Item {
} }
color: "white" color: "white"
font.pixelSize: 28 font.pointSize: 21
font.family: "Roboto" font.family: "Roboto"
font.weight: Font.Thin font.weight: Font.Thin

View File

@ -19,7 +19,7 @@ Item {
} }
color: "white" color: "white"
font.pixelSize: 28 font.pointSize: 21
font.family: "Roboto" font.family: "Roboto"
font.weight: Font.Thin font.weight: Font.Thin
@ -53,12 +53,14 @@ Item {
text: qsTr("Examples Widgets and Scenes") text: qsTr("Examples Widgets and Scenes")
font.family: "Roboto" font.family: "Roboto"
font.pixelSize: 18 font.pointSize: 16
color: "white" color: "white"
anchors { anchors {
top: btnCreateEmptyWidget.bottom top: btnCreateEmptyWidget.bottom
topMargin: 30 topMargin: 30
left:parent.left
leftMargin: 30
} }
} }

View File

@ -69,7 +69,7 @@ Item {
text: btnEmpty.text text: btnEmpty.text
font.family: "Roboto" font.family: "Roboto"
font.pixelSize: 18 font.pointSize: 14
color: "gray" color: "gray"
anchors { anchors {
left: imgIcon.right left: imgIcon.right
@ -82,7 +82,7 @@ Item {
text: ">" text: ">"
font.family: "Roboto" font.family: "Roboto"
font.pixelSize: 24 font.pointSize: 18
color: "#b9b9b9" color: "#b9b9b9"
anchors { anchors {
right: parent.right right: parent.right

View File

@ -22,8 +22,7 @@ Item {
font.family: "Segoe UI, Roboto" font.family: "Segoe UI, Roboto"
font.weight: Font.Light font.weight: Font.Light
color: Material.color(Material.Red) color: Material.color(Material.Red)
font.pointSize: 32
font.pixelSize: 32
} }
Rectangle { Rectangle {

View File

@ -20,7 +20,7 @@ Item {
font.weight: Font.Light font.weight: Font.Light
color: "#757575" color: "#757575"
font.pixelSize: 23 font.pointSize: 23
anchors { anchors {
top: parent.top top: parent.top
left: parent.left left: parent.left
@ -68,7 +68,7 @@ Item {
id: txtConvertNumber id: txtConvertNumber
color: "white" color: "white"
text: qsTr("") text: qsTr("")
font.pixelSize: 21 font.pointSize: 21
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
bottom: parent.bottom bottom: parent.bottom
@ -80,7 +80,7 @@ Item {
id: txtConvert id: txtConvert
color: "white" color: "white"
text: qsTr("Generating preview video...") text: qsTr("Generating preview video...")
font.pixelSize: 14 font.pointSize: 14
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
bottom: parent.bottom bottom: parent.bottom

View File

@ -71,17 +71,15 @@ Item {
Rectangle { Rectangle {
id: wrapper id: wrapper
width: 910
radius: 4
height: 460
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
top: parent.top top: parent.top
topMargin: 0 topMargin: 0
} }
width: 910
radius: 4
height: 460
Loader { Loader {
id: loader_wrapperContent id: loader_wrapperContent
anchors.fill: parent anchors.fill: parent

View File

@ -62,7 +62,7 @@ DropArea {
Text { Text {
id: text1 id: text1
text: qsTr("Bad File!!") text: qsTr("Bad File!!")
font.pixelSize: 24 font.pointSize: 24
opacity: 1 opacity: 1
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter

View File

@ -102,7 +102,7 @@ Item {
text: qsTr("Pull to refresh!") text: qsTr("Pull to refresh!")
anchors.centerIn: parent anchors.centerIn: parent
color: "gray" color: "gray"
font.pixelSize: 18 font.pointSize: 18
} }
} }
footer: Item { footer: Item {

View File

@ -70,7 +70,7 @@ Item {
id: txtHeadline2 id: txtHeadline2
text: qsTr("DISTINCT") text: qsTr("DISTINCT")
font.family: "Roboto Mono Thin" font.family: "Roboto Mono Thin"
font.pixelSize: 75 font.pointSize: 75
color: "white" color: "white"
font.weight: Font.Normal font.weight: Font.Normal

View File

@ -165,7 +165,7 @@ Item {
font.family: "Roboto" font.family: "Roboto"
font.weight: Font.Thin font.weight: Font.Thin
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.pixelSize: 21 font.pointSize: 16
color: "#2F2F2F" color: "#2F2F2F"
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
anchors { anchors {
@ -185,7 +185,7 @@ Item {
horizontalAlignment: Qt.AlignHCenter horizontalAlignment: Qt.AlignHCenter
font.family: "Roboto" font.family: "Roboto"
font.pixelSize: 18 font.pointSize: 14
color: "#2F2F2F" color: "#2F2F2F"
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
anchors { anchors {
@ -239,7 +239,7 @@ Item {
font.family: "Roboto" font.family: "Roboto"
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.pixelSize: 14 font.pointSize: 10
color: "#626262" color: "#626262"
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
anchors { anchors {
@ -294,7 +294,7 @@ Item {
font.family: "Roboto" font.family: "Roboto"
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.pixelSize: 14 font.pointSize: 10
color: "#626262" color: "#626262"
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
anchors { anchors {

View File

@ -14,7 +14,7 @@ Item {
imgPreview.opacity = 1 imgPreview.opacity = 1
} }
property int fontSize: 14 property int fontSize: 10
property int index property int index
property bool isSelected: false property bool isSelected: false
property bool isWallpaperActive: false property bool isWallpaperActive: false
@ -42,7 +42,7 @@ Item {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
//color: "white" //color: "white"
font.pixelSize: monitorSelectionItem.fontSize font.pointSize: monitorSelectionItem.fontSize
font.family: "Roboto" font.family: "Roboto"
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
} }

View File

@ -59,7 +59,7 @@ Item {
Text { Text {
id: txtHeadline id: txtHeadline
text: qsTr("Wallpaper Configuration") text: qsTr("Wallpaper Configuration")
font.pixelSize: 21 font.pointSize: 21
color: "#626262" color: "#626262"
font.family: "Roboto" font.family: "Roboto"
font.weight: Font.Thin font.weight: Font.Thin

View File

@ -21,7 +21,7 @@ Item {
id: txtDescription id: txtDescription
text: name text: name
width: 100 width: 100
font.pixelSize: isHeadline ? 21 : 14 font.pointSize: isHeadline ? 21 : 14
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font.family: "Roboto" font.family: "Roboto"
font.weight: Font.Normal font.weight: Font.Normal

View File

@ -1,6 +1,7 @@
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.2
Item { Item {
id: settingsBool id: settingsBool
property string headline: "Headline" property string headline: "Headline"
@ -36,7 +37,7 @@ Item {
} }
font.pixelSize: 16 font.pointSize: 12
font.family: "Roboto" font.family: "Roboto"
} }
@ -48,7 +49,7 @@ Item {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
font.pixelSize: 12 font.pointSize: 10
font.family: "Roboto" font.family: "Roboto"
anchors{ anchors{
top:txtHeadline.bottom top:txtHeadline.bottom

View File

@ -147,7 +147,7 @@ Item {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
font.pixelSize: 14 font.pointSize: 10
font.family: "Roboto" font.family: "Roboto"
anchors{ anchors{
right:parent.right right:parent.right
@ -345,7 +345,7 @@ Item {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
font.pixelSize: 16 font.pointSize: 16
anchors { anchors {
top: parent.top top: parent.top
topMargin: 6 topMargin: 6
@ -361,7 +361,7 @@ Item {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
verticalAlignment: Text.AlignTop verticalAlignment: Text.AlignTop
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
font.pixelSize: 14 font.pointSize: 10
font.family: "Roboto" font.family: "Roboto"
width: parent.width * .6 width: parent.width * .6
anchors { anchors {

View File

@ -42,7 +42,7 @@ Item {
} }
font.pixelSize: 16 font.pointSize: 12
} }
Text { Text {
@ -53,7 +53,7 @@ Item {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
font.pixelSize: 12 font.pointSize: 10
font.family: "Roboto" font.family: "Roboto"
anchors{ anchors{
top:txtHeadline.bottom top:txtHeadline.bottom

View File

@ -36,7 +36,7 @@ Item {
} }
font.pixelSize: 16 font.pointSize: 12
font.family: "Roboto" font.family: "Roboto"
} }
@ -48,7 +48,7 @@ Item {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.pixelSize: 12 font.pointSize: 10
font.family: "Roboto" font.family: "Roboto"
anchors{ anchors{
top:txtHeadline.bottom top:txtHeadline.bottom

View File

@ -62,7 +62,7 @@ Item {
Text { Text {
id: txtHeadline id: txtHeadline
text: settingsHeader.text text: settingsHeader.text
font.pixelSize: 18 font.pointSize: 12
color: "white" color: "white"
verticalAlignment: Text.AlignTop verticalAlignment: Text.AlignTop

View File

@ -25,7 +25,7 @@ Window {
id: text1 id: text1
color: "#ffffff" color: "#ffffff"
text: "empty" text: "empty"
font.pixelSize: 29 font.pointSize: 29
} }