1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 02:32:29 +01:00

Add tasks.json and format all files

This commit is contained in:
Elias Steurer 2023-02-02 15:25:26 +01:00
parent f942ce16dc
commit 83bb652132
108 changed files with 1383 additions and 1940 deletions

95
.vscode/tasks.json vendored
View File

@ -12,6 +12,99 @@
"group": "build", "group": "build",
"problemMatcher": [], "problemMatcher": [],
"detail": "CMake template build task" "detail": "CMake template build task"
} },
{
"type": "process",
"label": "Format Cpp files",
"command": "python",
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}/Tools"
},
"args": [
"clang_format.py"
]
},
{
"type": "process",
"label": "Format CMake files",
"command": "python",
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}/Tools"
},
"args": [
"cmake_format.py"
]
},
{
"type": "process",
"label": "Format Qml files",
"command": "python",
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}/Tools"
},
"args": [
"qml_format.py"
]
},
{
"type": "process",
"label": "Run setup.py",
"command": "python",
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}/Tools"
},
"args": [
"setup.py"
]
},
{
"type": "process",
"label": "Export ScreenPlay release, with deploy and steam enabled",
"command": "python",
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}/Tools"
},
"args": [
"build.py",
"-type=release",
"-deploy_version",
"-steam"
]
},
{
"type": "process",
"label": "Update Qt *.ts translations",
"command": "python",
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}/Tools"
},
"args": [
"update_translations.py"
]
}
] ]
} }

View File

@ -219,7 +219,6 @@ set(RESOURCES
assets/startinfo/vscode.png assets/startinfo/vscode.png
assets/wizards/example_html.png assets/wizards/example_html.png
assets/wizards/example_qml.png assets/wizards/example_qml.png
assets/wizards/QmlProject.qmlproject
assets/wizards/License_All_Rights_Reserved_1.0.txt assets/wizards/License_All_Rights_Reserved_1.0.txt
assets/wizards/License_Apache_2.0.txt assets/wizards/License_Apache_2.0.txt
assets/wizards/License_CC0_1.0.txt assets/wizards/License_CC0_1.0.txt
@ -227,6 +226,7 @@ set(RESOURCES
assets/wizards/License_CC_Attribution-ShareAlike_4.0.txt assets/wizards/License_CC_Attribution-ShareAlike_4.0.txt
assets/wizards/License_CC_Attribution_4.0.txt assets/wizards/License_CC_Attribution_4.0.txt
assets/wizards/License_GPL_3.0.txt assets/wizards/License_GPL_3.0.txt
assets/wizards/QmlProject.qmlproject
assets/WorkshopPreview.html assets/WorkshopPreview.html
legal/DataProtection.txt legal/DataProtection.txt
legal/gpl-3.0.txt legal/gpl-3.0.txt

View File

@ -1,9 +1,9 @@
// SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only // SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only
#include "ScreenPlay/app.h" #include "ScreenPlay/app.h"
#include <QGuiApplication>
#include <QCommandLineParser> #include <QCommandLineParser>
#include <QDebug> #include <QDebug>
#include <QGuiApplication>
#include <QStyleFactory> #include <QStyleFactory>
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)

View File

@ -20,40 +20,35 @@ ApplicationWindow {
function setTheme(theme) { function setTheme(theme) {
switch (theme) { switch (theme) {
case Settings.System: case Settings.System:
root.Material.theme = Material.System root.Material.theme = Material.System;
break break;
case Settings.Dark: case Settings.Dark:
root.Material.theme = Material.Dark root.Material.theme = Material.Dark;
break break;
case Settings.Light: case Settings.Light:
root.Material.theme = Material.Light root.Material.theme = Material.Light;
break break;
} }
} }
function switchPage(name) { function switchPage(name) {
if (nav.currentNavigationName === name) { if (nav.currentNavigationName === name) {
if (name === "Installed") if (name === "Installed")
App.installedListModel.reset() App.installedListModel.reset();
} }
if (name === "Installed") { if (name === "Installed") {
stackView.replace( stackView.replace("qrc:/qml/ScreenPlayApp/qml/Installed/Installed.qml", {
"qrc:/qml/ScreenPlayApp/qml/Installed/Installed.qml", { "sidebar": sidebar
"sidebar": sidebar });
}) return;
return
} }
stackView.replace( stackView.replace("qrc:/qml/ScreenPlayApp/qml/" + name + "/" + name + ".qml", {
"qrc:/qml/ScreenPlayApp/qml/" + name + "/" + name + ".qml", "modalSource": content
{ });
"modalSource": content sidebar.state = "inactive";
})
sidebar.state = "inactive"
} }
color: Material.theme === Material.Dark ? Qt.darker( color: Material.theme === Material.Dark ? Qt.darker(Material.background) : Material.background
Material.background) : Material.background
// Set visible if the -silent parameter was not set (see app.cpp end of constructor). // Set visible if the -silent parameter was not set (see app.cpp end of constructor).
visible: false visible: false
width: 1400 width: 1400
@ -67,28 +62,23 @@ ApplicationWindow {
Material.accent: Material.color(Material.Orange) Material.accent: Material.color(Material.Orange)
onVisibilityChanged: { onVisibilityChanged: {
if (root.visibility === 2) if (root.visibility === 2)
App.installedListModel.reset() App.installedListModel.reset();
} }
onClosing: (close) => { onClosing: close => {
close.accepted = false close.accepted = false;
if (App.screenPlayManager.activeWallpaperCounter === 0 && App.screenPlayManager.activeWidgetsCounter === 0) {
if (App.screenPlayManager.activeWallpaperCounter === 0 Qt.quit();
&& App.screenPlayManager.activeWidgetsCounter === 0) {
Qt.quit()
} }
const alwaysMinimize = settings.value("alwaysMinimize", null);
const alwaysMinimize = settings.value("alwaysMinimize", null) if (alwaysMinimize === null) {
if(alwaysMinimize === null){ console.error("Unable to retreive alwaysMinimize setting");
console.error("Unable to retreive alwaysMinimize setting")
} }
if (alwaysMinimize === "true") {
if(alwaysMinimize === "true"){ root.hide();
root.hide() App.showDockIcon(false);
App.showDockIcon(false); return;
return
} }
exitDialog.open();
exitDialog.open()
} }
Labs.Settings { Labs.Settings {
@ -102,13 +92,13 @@ ApplicationWindow {
} }
Component.onCompleted: { Component.onCompleted: {
setTheme(App.settings.theme) setTheme(App.settings.theme);
stackView.push("qrc:/qml/ScreenPlayApp/qml/Installed/Installed.qml", { stackView.push("qrc:/qml/ScreenPlayApp/qml/Installed/Installed.qml", {
"sidebar": sidebar "sidebar": sidebar
}) });
if (!App.settings.silentStart){ if (!App.settings.silentStart) {
App.showDockIcon(true) App.showDockIcon(true);
root.show() root.show();
} }
} }
@ -139,7 +129,7 @@ ApplicationWindow {
Connections { Connections {
function onThemeChanged(theme) { function onThemeChanged(theme) {
setTheme(theme) setTheme(theme);
} }
target: App.settings target: App.settings
@ -147,7 +137,7 @@ ApplicationWindow {
Connections { Connections {
function onRequestNavigation(nav) { function onRequestNavigation(nav) {
switchPage(nav) switchPage(nav);
} }
target: App.util target: App.util
@ -155,8 +145,8 @@ ApplicationWindow {
Connections { Connections {
function onRequestRaise() { function onRequestRaise() {
App.showDockIcon(true) App.showDockIcon(true);
root.show() root.show();
} }
target: App.screenPlayManager target: App.screenPlayManager
@ -164,98 +154,97 @@ ApplicationWindow {
Item { Item {
id: content id: content
anchors.fill:parent anchors.fill: parent
StackView {
id: stackView
objectName: "stackView"
property int duration: 300
StackView { anchors {
id: stackView top: nav.bottom
objectName: "stackView" right: parent.right
property int duration: 300 bottom: parent.bottom
left: parent.left
anchors {
top: nav.bottom
right: parent.right
bottom: parent.bottom
left: parent.left
}
replaceEnter: Transition {
OpacityAnimator {
from: 0
to: 1
duration: stackView.duration
easing.type: Easing.InOutQuart
} }
ScaleAnimator { replaceEnter: Transition {
from: 0.8 OpacityAnimator {
to: 1 from: 0
duration: stackView.duration to: 1
easing.type: Easing.InOutQuart duration: stackView.duration
easing.type: Easing.InOutQuart
}
ScaleAnimator {
from: 0.8
to: 1
duration: stackView.duration
easing.type: Easing.InOutQuart
}
}
replaceExit: Transition {
OpacityAnimator {
from: 1
to: 0
duration: stackView.duration
easing.type: Easing.InOutQuart
}
ScaleAnimator {
from: 1
to: 0.8
duration: stackView.duration
easing.type: Easing.InOutQuart
}
} }
} }
replaceExit: Transition { Connections {
OpacityAnimator { function onSetSidebarActive(active) {
from: 1 if (active)
to: 0 sidebar.state = "active";
duration: stackView.duration else
easing.type: Easing.InOutQuart sidebar.state = "inactive";
} }
ScaleAnimator { function onSetNavigationItem(pos) {
from: 1 if (pos === 0)
to: 0.8 nav.onPageChanged("Create");
duration: stackView.duration else
easing.type: Easing.InOutQuart nav.onPageChanged("Workshop");
}
target: stackView.currentItem
ignoreUnknownSignals: true
}
Installed.Sidebar {
id: sidebar
objectName: "installedSidebar"
navHeight: nav.height
anchors {
top: parent.top
right: parent.right
bottom: parent.bottom
} }
} }
}
Connections { Navigation.Navigation {
function onSetSidebarActive(active) { id: nav
if (active) modalSource: content
sidebar.state = "active" anchors {
else top: parent.top
sidebar.state = "inactive" right: parent.right
} left: parent.left
}
function onSetNavigationItem(pos) { onChangePage: function (name) {
if (pos === 0) monitors.close();
nav.onPageChanged("Create") switchPage(name);
else }
nav.onPageChanged("Workshop")
}
target: stackView.currentItem
ignoreUnknownSignals: true
}
Installed.Sidebar {
id: sidebar
objectName: "installedSidebar"
navHeight: nav.height
anchors {
top: parent.top
right: parent.right
bottom: parent.bottom
}
}
Navigation.Navigation {
id: nav
modalSource: content
anchors {
top: parent.top
right: parent.right
left: parent.left
}
onChangePage: function (name) {
monitors.close()
switchPage(name)
} }
} }
} }
}

View File

@ -42,7 +42,6 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
} }
Button { Button {
text: qsTr("News") text: qsTr("News")
onClicked: Qt.openUrlExternally("https://screen-play.app/blog/") onClicked: Qt.openUrlExternally("https://screen-play.app/blog/")
@ -54,8 +53,7 @@ Item {
Button { Button {
text: qsTr("Wiki") text: qsTr("Wiki")
onClicked: Qt.openUrlExternally( onClicked: Qt.openUrlExternally("https://kelteseth.gitlab.io/ScreenPlayDocs/")
"https://kelteseth.gitlab.io/ScreenPlayDocs/")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_help_center.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_help_center.svg"
icon.width: 14 icon.width: 14
icon.height: 14 icon.height: 14
@ -64,8 +62,7 @@ Item {
Button { Button {
text: qsTr("Forum") text: qsTr("Forum")
onClicked: Qt.openUrlExternally( onClicked: Qt.openUrlExternally("https://forum.screen-play.app/")
"https://forum.screen-play.app/")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_forum.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_forum.svg"
icon.width: 14 icon.width: 14
icon.height: 14 icon.height: 14
@ -74,8 +71,7 @@ Item {
Button { Button {
text: qsTr("Reddit") text: qsTr("Reddit")
onClicked: Qt.openUrlExternally( onClicked: Qt.openUrlExternally("https://www.reddit.com/r/ScreenPlayApp/")
"https://www.reddit.com/r/ScreenPlayApp/")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/brand_reddit.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/brand_reddit.svg"
icon.width: 14 icon.width: 14
icon.height: 14 icon.height: 14
@ -84,8 +80,7 @@ Item {
Button { Button {
text: qsTr("Issue Tracker") text: qsTr("Issue Tracker")
onClicked: Qt.openUrlExternally( onClicked: Qt.openUrlExternally("https://gitlab.com/kelteseth/ScreenPlay/-/issues")
"https://gitlab.com/kelteseth/ScreenPlay/-/issues")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_report_problem.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_report_problem.svg"
icon.width: 14 icon.width: 14
icon.height: 14 icon.height: 14
@ -94,8 +89,7 @@ Item {
Button { Button {
text: qsTr("Contribute") text: qsTr("Contribute")
onClicked: Qt.openUrlExternally( onClicked: Qt.openUrlExternally("https://gitlab.com/kelteseth/ScreenPlay#general-contributing")
"https://gitlab.com/kelteseth/ScreenPlay#general-contributing")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_supervisor_account.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_supervisor_account.svg"
icon.width: 14 icon.width: 14
icon.height: 14 icon.height: 14
@ -115,7 +109,6 @@ Item {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
} }

View File

@ -27,7 +27,6 @@ TabButton {
right: txt.left right: txt.left
verticalCenter: txt.verticalCenter verticalCenter: txt.verticalCenter
} }
} }
Text { Text {
@ -63,12 +62,9 @@ TabButton {
topMargin: 15 topMargin: 15
right: parent.right right: parent.right
} }
} }
} }
background: Item { background: Item {
} }
} }

View File

@ -58,7 +58,6 @@ Item {
name: "description" name: "description"
elementName: "description" elementName: "description"
} }
} }
header: Item { header: Item {
@ -82,9 +81,7 @@ Item {
topMargin: 30 topMargin: 30
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
} }
} }
delegate: Item { delegate: Item {
@ -108,13 +105,11 @@ Item {
source: image source: image
opacity: status === Image.Ready ? 1 : 0 opacity: status === Image.Ready ? 1 : 0
Behavior on opacity { Behavior on opacity {
PropertyAnimation { PropertyAnimation {
duration: 250 duration: 250
} }
} }
} }
LinearGradient { LinearGradient {
@ -132,9 +127,7 @@ Item {
position: 0 position: 0
color: "transparent" color: "transparent"
} }
} }
} }
Text { Text {
@ -153,7 +146,6 @@ Item {
left: parent.left left: parent.left
margins: 20 margins: 20
} }
} }
Text { Text {
@ -173,7 +165,6 @@ Item {
left: parent.left left: parent.left
leftMargin: 20 leftMargin: 20
} }
} }
MouseArea { MouseArea {
@ -184,7 +175,6 @@ Item {
onEntered: delegate.state = "hover" onEntered: delegate.state = "hover"
onExited: delegate.state = "" onExited: delegate.state = ""
} }
} }
transitions: [ transitions: [
@ -198,7 +188,6 @@ Item {
from: 1 from: 1
to: 1.05 to: 1.05
} }
}, },
Transition { Transition {
from: "hover" from: "hover"
@ -210,7 +199,6 @@ Item {
from: 1.05 from: 1.05
to: 1 to: 1
} }
} }
] ]
} }
@ -219,7 +207,5 @@ Item {
snapMode: ScrollBar.SnapOnRelease snapMode: ScrollBar.SnapOnRelease
policy: ScrollBar.AlwaysOn policy: ScrollBar.AlwaysOn
} }
} }
} }

View File

@ -29,7 +29,6 @@ Item {
left: parent.left left: parent.left
bottom: parent.bottom bottom: parent.bottom
} }
} }
Item { Item {
@ -80,7 +79,6 @@ Item {
duration: 400 duration: 400
easing.type: Easing.InOutQuart easing.type: Easing.InOutQuart
} }
} }
pushExit: Transition { pushExit: Transition {
@ -99,15 +97,12 @@ Item {
duration: 400 duration: 400
easing.type: Easing.InOutQuart easing.type: Easing.InOutQuart
} }
} }
} }
layer.effect: ElevationEffect { layer.effect: ElevationEffect {
elevation: 6 elevation: 6
} }
} }
states: [ states: [
@ -119,7 +114,6 @@ Item {
anchors.topMargin: wizardContentWrapper.anchors.margins anchors.topMargin: wizardContentWrapper.anchors.margins
opacity: 1 opacity: 1
} }
} }
] ]
transitions: [ transitions: [
@ -141,11 +135,8 @@ Item {
wizardContentWrapper.anchors.left = sidebar.right; wizardContentWrapper.anchors.left = sidebar.right;
} }
} }
} }
} }
] ]
} }
} }

View File

@ -37,15 +37,15 @@ Rectangle {
id: loaderConnections id: loaderConnections
function onWizardStarted() { function onWizardStarted() {
root.expanded = false root.expanded = false;
} }
function onWizardExited() { function onWizardExited() {
root.expanded = true root.expanded = true;
stackView.clear(StackView.PushTransition) stackView.clear(StackView.PushTransition);
stackView.push("qrc:/qml/ScreenPlayApp/qml/Create/StartInfo.qml") stackView.push("qrc:/qml/ScreenPlayApp/qml/Create/StartInfo.qml");
listView.currentIndex = 0 listView.currentIndex = 0;
App.util.setNavigationActive(true) App.util.setNavigationActive(true);
} }
ignoreUnknownSignals: true ignoreUnknownSignals: true
@ -152,9 +152,9 @@ Rectangle {
highlighted: ListView.isCurrentItem highlighted: ListView.isCurrentItem
text: headline text: headline
onClicked: { onClicked: {
listView.currentIndex = index listView.currentIndex = index;
const item = stackView.push(source) const item = stackView.push(source);
loaderConnections.target = item loaderConnections.target = item;
} }
} }
} }

View File

@ -1,6 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Controls.Material import QtQuick.Controls.Material
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material.impl import QtQuick.Controls.Material.impl
@ -23,7 +23,6 @@ Item {
left: parent.left left: parent.left
margins: 20 margins: 20
} }
} }
Text { Text {
@ -40,7 +39,6 @@ Item {
left: parent.left left: parent.left
margins: 20 margins: 20
} }
} }
GridView { GridView {
@ -217,7 +215,6 @@ Item {
description: "" description: ""
category: "Resources" category: "Resources"
} }
} }
delegate: StartInfoLinkImage { delegate: StartInfoLinkImage {
@ -231,7 +228,5 @@ Item {
width: gridView.cellWidth width: gridView.cellWidth
height: gridView.cellHeight height: gridView.cellHeight
} }
} }
} }

View File

@ -1,6 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Controls.Material import QtQuick.Controls.Material
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material.impl import QtQuick.Controls.Material.impl
@ -48,9 +48,7 @@ Item {
position: 1 position: 1
color: "#00000000" color: "#00000000"
} }
} }
} }
Text { Text {
@ -67,7 +65,6 @@ Item {
margins: 15 margins: 15
bottomMargin: 5 bottomMargin: 5
} }
} }
Text { Text {
@ -84,7 +81,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 15 margins: 15
} }
} }
Rectangle { Rectangle {
@ -108,9 +104,7 @@ Item {
fill: parent fill: parent
margins: 5 margins: 5
} }
} }
} }
MouseArea { MouseArea {
@ -125,7 +119,6 @@ Item {
layer.effect: ElevationEffect { layer.effect: ElevationEffect {
elevation: 4 elevation: 4
} }
} }
transitions: [ transitions: [
@ -139,7 +132,6 @@ Item {
from: 1 from: 1
to: 1.05 to: 1.05
} }
}, },
Transition { Transition {
from: "hover" from: "hover"
@ -151,7 +143,6 @@ Item {
from: 1.05 from: 1.05
to: 1 to: 1
} }
} }
] ]
} }

View File

@ -6,7 +6,7 @@ import QtQuick.Layouts
import ScreenPlayApp import ScreenPlayApp
import ScreenPlay import ScreenPlay
import ScreenPlay.Create import ScreenPlay.Create
import ScreenPlayUtil import ScreenPlayUtil
Item { Item {
id: root id: root
@ -42,7 +42,6 @@ Item {
right: wrapper.right right: wrapper.right
topMargin: 3 topMargin: 3
} }
} }
Rectangle { Rectangle {
@ -53,7 +52,6 @@ Item {
radius: 4 radius: 4
width: { width: {
// Add small margin left and right // Add small margin left and right
if (parent.width < 1200) if (parent.width < 1200)
return parent.width - 20; return parent.width - 20;
else else
@ -86,9 +84,7 @@ Item {
App.util.setNavigation("Create"); App.util.setNavigation("Create");
} }
} }
} }
} }
states: [ states: [
@ -105,7 +101,6 @@ Item {
target: effect target: effect
opacity: 0 opacity: 0
} }
}, },
State { State {
name: "in" name: "in"
@ -125,7 +120,6 @@ Item {
target: effect target: effect
opacity: 0.4 opacity: 0.4
} }
}, },
State { State {
name: "error" name: "error"
@ -146,7 +140,6 @@ Item {
opacity: 1 opacity: 1
z: 1 z: 1
} }
}, },
State { State {
name: "success" name: "success"
@ -167,7 +160,6 @@ Item {
opacity: 0 opacity: 0
z: 0 z: 0
} }
} }
] ]
transitions: [ transitions: [
@ -206,13 +198,9 @@ Item {
property: "opacity" property: "opacity"
easing.type: Easing.OutQuart easing.type: Easing.OutQuart
} }
} }
} }
} }
}, },
Transition { Transition {
from: "in" from: "in"
@ -244,11 +232,8 @@ Item {
property: "opacity" property: "opacity"
easing.type: Easing.OutQuart easing.type: Easing.OutQuart
} }
} }
} }
}, },
Transition { Transition {
from: "in" from: "in"
@ -265,9 +250,7 @@ Item {
PauseAnimation { PauseAnimation {
duration: 50 duration: 50
} }
} }
} }
] ]
} }

View File

@ -84,7 +84,7 @@ WizardPage {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width width: parent.width
anchors{ anchors {
fill: parent fill: parent
margins: 40 margins: 40
} }
@ -97,7 +97,6 @@ WizardPage {
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
source: root.file source: root.file
} }
} }
Item { Item {
@ -113,7 +112,6 @@ WizardPage {
fileDialog.nameFilters: ["Gif (*.gif)"] fileDialog.nameFilters: ["Gif (*.gif)"]
onFileChanged: root.file = file onFileChanged: root.file = file
} }
} }
ColumnLayout { ColumnLayout {
@ -162,11 +160,7 @@ WizardPage {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
} }
} }
} }

View File

@ -53,7 +53,6 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
placeholderText: qsTr("Created By") placeholderText: qsTr("Created By")
} }
} }
Util.TextField { Util.TextField {
@ -83,7 +82,6 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
Item { Item {
@ -99,7 +97,5 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
} }

View File

@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls.Material import QtQuick.Controls.Material
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import ScreenPlayApp import ScreenPlayApp
import ScreenPlay import ScreenPlay
import ScreenPlayUtil as Util import ScreenPlayUtil as Util
@ -52,7 +51,6 @@ WizardPage {
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
} }
} }
Util.ImageSelector { Util.ImageSelector {
@ -60,7 +58,6 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
ColumnLayout { ColumnLayout {
@ -104,11 +101,7 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
} }
} }
} }

View File

@ -23,15 +23,15 @@ Item {
CreateWallpaperInit { CreateWallpaperInit {
onNext: function (filePath, codec) { onNext: function (filePath, codec) {
startConvert(filePath, codec) startConvert(filePath, codec);
} }
function startConvert(filePath, codec) { function startConvert(filePath, codec) {
root.wizardStarted() root.wizardStarted();
swipeView.currentIndex = 1 swipeView.currentIndex = 1;
createWallpaperVideoImportConvert.codec = codec createWallpaperVideoImportConvert.codec = codec;
createWallpaperVideoImportConvert.filePath = filePath createWallpaperVideoImportConvert.filePath = filePath;
App.create.createWallpaperStart(filePath, codec, quality) App.create.createWallpaperStart(filePath, codec, quality);
} }
} }
@ -41,6 +41,7 @@ Item {
onAbort: root.wizardExited() onAbort: root.wizardExited()
} }
CreateWallpaperResult {} CreateWallpaperResult {
}
} }
} }

View File

@ -8,6 +8,7 @@ import ScreenPlayApp
import ScreenPlay import ScreenPlay
import ScreenPlay.Create import ScreenPlay.Create
import ScreenPlayUtil as Util import ScreenPlayUtil as Util
Item { Item {
id: root id: root
objectName: "createWallpaperInit" objectName: "createWallpaperInit"
@ -62,7 +63,6 @@ Item {
// text: "AV1 (NVidia 3000, AMD 6000 or newer). ULTRA SLOW ENCODING!" // text: "AV1 (NVidia 3000, AMD 6000 or newer). ULTRA SLOW ENCODING!"
// value: Create.AV1 // value: Create.AV1
// } // }
id: comboBoxCodec id: comboBoxCodec
Layout.preferredWidth: 400 Layout.preferredWidth: 400
@ -84,11 +84,8 @@ Item {
value: Create.VP8 value: Create.VP8
} }
// Import works but the QWebEngine cannot display AV1 :( // Import works but the QWebEngine cannot display AV1 :(
} }
} }
} }
Util.Slider { Util.Slider {
@ -104,9 +101,7 @@ Item {
to: 0 to: 0
stepSize: 1 stepSize: 1
} }
} }
} }
Button { Button {
@ -124,7 +119,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 20 margins: 20
} }
} }
Button { Button {
@ -141,7 +135,7 @@ Item {
nameFilters: ["Video files (*.mp4 *.mpg *.mp2 *.mpeg *.ogv *.avi *.wmv *.m4v *.3gp *.flv)"] nameFilters: ["Video files (*.mp4 *.mpg *.mp2 *.mpeg *.ogv *.avi *.wmv *.m4v *.3gp *.flv)"]
onAccepted: { onAccepted: {
root.next(fileDialogImportVideo.currentFile , model.get(comboBoxCodec.currentIndex).value); root.next(fileDialogImportVideo.currentFile, model.get(comboBoxCodec.currentIndex).value);
} }
} }
@ -150,7 +144,5 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 20 margins: 20
} }
} }
} }

View File

@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Controls.Material import QtQuick.Controls.Material
import QtQuick.Layouts import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import ScreenPlayApp import ScreenPlayApp
import ScreenPlay import ScreenPlay
@ -28,7 +27,6 @@ Item {
topMargin: 30 topMargin: 30
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
} }
Rectangle { Rectangle {
@ -66,7 +64,6 @@ Item {
left: parent.left left: parent.left
margins: 20 margins: 20
} }
} }
MouseArea { MouseArea {
@ -80,9 +77,7 @@ Item {
snapMode: ScrollBar.SnapOnRelease snapMode: ScrollBar.SnapOnRelease
policy: ScrollBar.AlwaysOn policy: ScrollBar.AlwaysOn
} }
} }
} }
Menu { Menu {
@ -94,7 +89,6 @@ Item {
App.util.copyToClipboard(txtFFMPEGDebug.text); App.util.copyToClipboard(txtFFMPEGDebug.text);
} }
} }
} }
Button { Button {
@ -114,7 +108,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 10 margins: 10
} }
} }
states: [ states: [
@ -125,7 +118,6 @@ Item {
target: txtFFMPEGDebug target: txtFFMPEGDebug
text: "Error!" text: "Error!"
} }
}, },
State { State {
name: "success" name: "success"
@ -134,7 +126,6 @@ Item {
target: txtFFMPEGDebug target: txtFFMPEGDebug
text: "Success!" text: "Success!"
} }
} }
] ]
} }

View File

@ -21,84 +21,81 @@ Item {
signal save signal save
function cleanup() { function cleanup() {
App.create.cancel() App.create.cancel();
} }
function basename(str) { function basename(str) {
let filenameWithExtentions = (str.slice(str.lastIndexOf("/") + 1)) let filenameWithExtentions = (str.slice(str.lastIndexOf("/") + 1));
let filename = filenameWithExtentions.split('.').slice(0, -1).join('.') let filename = filenameWithExtentions.split('.').slice(0, -1).join('.');
return filename return filename;
} }
function checkCanSave() { function checkCanSave() {
if (canSave && conversionFinishedSuccessful) if (canSave && conversionFinishedSuccessful)
btnSave.enabled = true btnSave.enabled = true;
else else
btnSave.enabled = false btnSave.enabled = false;
} }
onCanSaveChanged: root.checkCanSave() onCanSaveChanged: root.checkCanSave()
onFilePathChanged: { onFilePathChanged: {
textFieldName.text = basename(filePath) textFieldName.text = basename(filePath);
} }
Connections { Connections {
function onCreateWallpaperStateChanged(state) { function onCreateWallpaperStateChanged(state) {
switch (state) { switch (state) {
case ImportVideoState.ConvertingPreviewImage: case ImportVideoState.ConvertingPreviewImage:
txtConvert.text = qsTr("Generating preview image...") txtConvert.text = qsTr("Generating preview image...");
break break;
case ImportVideoState.ConvertingPreviewThumbnailImage: case ImportVideoState.ConvertingPreviewThumbnailImage:
txtConvert.text = qsTr("Generating preview thumbnail image...") txtConvert.text = qsTr("Generating preview thumbnail image...");
break break;
case ImportVideoState.ConvertingPreviewImageFinished: case ImportVideoState.ConvertingPreviewImageFinished:
imgPreview.source = "file:///" + App.create.workingDir + "/preview.jpg" imgPreview.source = "file:///" + App.create.workingDir + "/preview.jpg";
imgPreview.visible = true imgPreview.visible = true;
break break;
case ImportVideoState.ConvertingPreviewVideo: case ImportVideoState.ConvertingPreviewVideo:
txtConvert.text = qsTr("Generating 5 second preview video...") txtConvert.text = qsTr("Generating 5 second preview video...");
break break;
case ImportVideoState.ConvertingPreviewGif: case ImportVideoState.ConvertingPreviewGif:
txtConvert.text = qsTr("Generating preview gif...") txtConvert.text = qsTr("Generating preview gif...");
break break;
case ImportVideoState.ConvertingPreviewGifFinished: case ImportVideoState.ConvertingPreviewGifFinished:
gifPreview.source = "file:///" + App.create.workingDir + "/preview.gif" gifPreview.source = "file:///" + App.create.workingDir + "/preview.gif";
imgPreview.visible = false imgPreview.visible = false;
gifPreview.visible = true gifPreview.visible = true;
gifPreview.playing = true gifPreview.playing = true;
break break;
case ImportVideoState.ConvertingAudio: case ImportVideoState.ConvertingAudio:
txtConvert.text = qsTr("Converting Audio...") txtConvert.text = qsTr("Converting Audio...");
break break;
case ImportVideoState.ConvertingVideo: case ImportVideoState.ConvertingVideo:
txtConvert.text = qsTr( txtConvert.text = qsTr("Converting Video... This can take some time!");
"Converting Video... This can take some time!") break;
break
case ImportVideoState.ConvertingVideoError: case ImportVideoState.ConvertingVideoError:
txtConvert.text = qsTr("Converting Video ERROR!") txtConvert.text = qsTr("Converting Video ERROR!");
break break;
case ImportVideoState.AnalyseVideoError: case ImportVideoState.AnalyseVideoError:
txtConvert.text = qsTr("Analyse Video ERROR!") txtConvert.text = qsTr("Analyse Video ERROR!");
break break;
case ImportVideoState.Finished: case ImportVideoState.Finished:
txtConvert.text = "" txtConvert.text = "";
conversionFinishedSuccessful = true conversionFinishedSuccessful = true;
busyIndicator.running = false busyIndicator.running = false;
btnExit.enabled = false; btnExit.enabled = false;
root.checkCanSave() root.checkCanSave();
break break;
} }
} }
function onProgressChanged(progress) { function onProgressChanged(progress) {
var percentage = Math.floor(progress * 100) var percentage = Math.floor(progress * 100);
if (percentage > 100 || progress > 0.95) if (percentage > 100 || progress > 0.95)
percentage = 100 percentage = 100;
if (percentage === NaN) if (percentage === NaN)
print(progress, percentage) print(progress, percentage);
txtConvertNumber.text = percentage + "%";
txtConvertNumber.text = percentage + "%"
} }
target: App.create target: App.create
@ -278,9 +275,9 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
onTextChanged: { onTextChanged: {
if (textFieldName.text.length >= 3) if (textFieldName.text.length >= 3)
canSave = true canSave = true;
else else
canSave = false canSave = false;
} }
} }
@ -330,8 +327,8 @@ Item {
highlighted: true highlighted: true
font.family: App.settings.font font.family: App.settings.font
onClicked: { onClicked: {
root.abort() root.abort();
App.create.cancel() App.create.cancel();
} }
} }
@ -345,14 +342,9 @@ Item {
font.family: App.settings.font font.family: App.settings.font
onClicked: { onClicked: {
if (conversionFinishedSuccessful) { if (conversionFinishedSuccessful) {
btnSave.enabled = false btnSave.enabled = false;
App.create.saveWallpaper( App.create.saveWallpaper(textFieldName.text, textFieldDescription.text, root.filePath, previewSelector.imageSource, textFieldYoutubeURL.text, codec, textFieldTags.getTags());
textFieldName.text, savePopup.open();
textFieldDescription.text, root.filePath,
previewSelector.imageSource,
textFieldYoutubeURL.text, codec,
textFieldTags.getTags())
savePopup.open()
} }
} }
} }
@ -388,9 +380,9 @@ Item {
interval: 1000 + Math.random() * 1000 interval: 1000 + Math.random() * 1000
onTriggered: { onTriggered: {
savePopup.close() savePopup.close();
App.util.setNavigationActive(true) App.util.setNavigationActive(true);
App.util.setNavigation("Installed") App.util.setNavigation("Installed");
} }
} }
} }

View File

@ -23,11 +23,11 @@ Item {
ImportWebmInit { ImportWebmInit {
onNext: function (filePath) { onNext: function (filePath) {
root.wizardStarted() root.wizardStarted();
swipeView.currentIndex = 1 swipeView.currentIndex = 1;
createWallpaperVideoImportConvert.filePath = filePath createWallpaperVideoImportConvert.filePath = filePath;
App.util.setNavigationActive(false) App.util.setNavigationActive(false);
App.create.createWallpaperStart(filePath) App.create.createWallpaperStart(filePath);
} }
} }

View File

@ -16,8 +16,8 @@ Item {
property bool canSave: false property bool canSave: false
property string filePath property string filePath
signal exit() signal exit
signal save() signal save
function basename(str) { function basename(str) {
let filenameWithExtentions = (str.slice(str.lastIndexOf("/") + 1)); let filenameWithExtentions = (str.slice(str.lastIndexOf("/") + 1));
@ -91,10 +91,8 @@ Item {
var percentage = Math.floor(progress * 100); var percentage = Math.floor(progress * 100);
if (percentage > 100 || progress > 0.95) if (percentage > 100 || progress > 0.95)
percentage = 100; percentage = 100;
if (percentage === NaN) if (percentage === NaN)
print(progress, percentage); print(progress, percentage);
txtConvertNumber.text = percentage + "%"; txtConvertNumber.text = percentage + "%";
} }
@ -112,7 +110,6 @@ Item {
margins: 40 margins: 40
bottomMargin: 0 bottomMargin: 0
} }
} }
Item { Item {
@ -182,9 +179,7 @@ Item {
position: 1 position: 1
color: "#00000000" color: "#00000000"
} }
} }
} }
BusyIndicator { BusyIndicator {
@ -206,7 +201,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
bottomMargin: 40 bottomMargin: 40
} }
} }
Text { Text {
@ -222,9 +216,7 @@ Item {
bottom: parent.bottom bottom: parent.bottom
bottomMargin: 20 bottomMargin: 20
} }
} }
} }
Util.ImageSelector { Util.ImageSelector {
@ -238,9 +230,7 @@ Item {
left: parent.left left: parent.left
bottom: parent.bottom bottom: parent.bottom
} }
} }
} }
Item { Item {
@ -306,7 +296,6 @@ Item {
width: parent.width width: parent.width
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
Row { Row {
@ -352,9 +341,7 @@ Item {
} }
} }
} }
} }
} }
Popup { Popup {
@ -391,7 +378,5 @@ Item {
root.exit(); root.exit();
} }
} }
} }
} }

View File

@ -107,32 +107,10 @@ Item {
fill: parent fill: parent
margins: 40 margins: 40
} }
} }
} }
} }
Item {
Layout.fillHeight: true
Layout.preferredWidth: wrapper.width * 0.33
StartInfoLinkImage {
text: "Handbreak"
image: "qrc:/qml/ScreenPlayApp/assets/startinfo/handbreak.png"
link: "https://handbrake.fr/"
description: "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cum sociis natoque penatibus et magnis dis parturient montes,"
category: "Tools"
width: 300
height: parent.height
anchors.centerIn: parent
}
}
} }
} }
Button { Button {
@ -153,7 +131,6 @@ Item {
left: parent.left left: parent.left
margins: 20 margins: 20
} }
} }
Button { Button {
@ -178,7 +155,5 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 20 margins: 20
} }
} }
} }

View File

@ -23,11 +23,11 @@ Item {
Importh264Init { Importh264Init {
onNext: function (filePath) { onNext: function (filePath) {
root.wizardStarted() root.wizardStarted();
swipeView.currentIndex = 1 swipeView.currentIndex = 1;
createWallpaperVideoImportConvert.filePath = filePath createWallpaperVideoImportConvert.filePath = filePath;
App.util.setNavigationActive(false) App.util.setNavigationActive(false);
App.create.importH264(filePath) App.create.importH264(filePath);
} }
} }

View File

@ -16,8 +16,8 @@ Item {
property bool canSave: false property bool canSave: false
property string filePath property string filePath
signal exit() signal exit
signal save() signal save
function basename(str) { function basename(str) {
let filenameWithExtentions = (str.slice(str.lastIndexOf("/") + 1)); let filenameWithExtentions = (str.slice(str.lastIndexOf("/") + 1));
@ -91,10 +91,8 @@ Item {
var percentage = Math.floor(progress * 100); var percentage = Math.floor(progress * 100);
if (percentage > 100 || progress > 0.95) if (percentage > 100 || progress > 0.95)
percentage = 100; percentage = 100;
if (percentage === NaN) if (percentage === NaN)
print(progress, percentage); print(progress, percentage);
txtConvertNumber.text = percentage + "%"; txtConvertNumber.text = percentage + "%";
} }
@ -112,7 +110,6 @@ Item {
margins: 40 margins: 40
bottomMargin: 0 bottomMargin: 0
} }
} }
Item { Item {
@ -182,9 +179,7 @@ Item {
position: 1 position: 1
color: "#00000000" color: "#00000000"
} }
} }
} }
BusyIndicator { BusyIndicator {
@ -206,7 +201,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
bottomMargin: 40 bottomMargin: 40
} }
} }
Text { Text {
@ -222,9 +216,7 @@ Item {
bottom: parent.bottom bottom: parent.bottom
bottomMargin: 20 bottomMargin: 20
} }
} }
} }
Util.ImageSelector { Util.ImageSelector {
@ -238,9 +230,7 @@ Item {
left: parent.left left: parent.left
bottom: parent.bottom bottom: parent.bottom
} }
} }
} }
Item { Item {
@ -306,7 +296,6 @@ Item {
width: parent.width width: parent.width
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
Row { Row {
@ -352,9 +341,7 @@ Item {
} }
} }
} }
} }
} }
Popup { Popup {
@ -391,7 +378,5 @@ Item {
root.exit(); root.exit();
} }
} }
} }
} }

View File

@ -60,22 +60,19 @@ Item {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
onExited: { onExited: {
bg.color = Qt.darker(Material.backgroundColor) bg.color = Qt.darker(Material.backgroundColor);
} }
onEntered: { onEntered: {
bg.color = Qt.darker(Qt.darker( bg.color = Qt.darker(Qt.darker(Material.backgroundColor));
Material.backgroundColor)) drag.accept(Qt.LinkAction);
drag.accept(Qt.LinkAction)
} }
onDropped: { onDropped: {
let file = App.util.toLocal(drop.urls[0]) let file = App.util.toLocal(drop.urls[0]);
bg.color = Qt.darker(Qt.darker( bg.color = Qt.darker(Qt.darker(Material.backgroundColor));
Material.backgroundColor))
if (file.endsWith(".mp4")) if (file.endsWith(".mp4"))
root.next(drop.urls[0]) root.next(drop.urls[0]);
else else
txtFile.text = qsTr( txtFile.text = qsTr("Invalid file type. Must be valid h264 (*.mp4)!");
"Invalid file type. Must be valid h264 (*.mp4)!")
} }
Rectangle { Rectangle {
@ -127,8 +124,7 @@ Item {
icon.width: 16 icon.width: 16
icon.height: 16 icon.height: 16
font.family: App.settings.font font.family: App.settings.font
onClicked: Qt.openUrlExternally( onClicked: Qt.openUrlExternally("https://kelteseth.gitlab.io/ScreenPlayDocs/wallpaper/wallpaper/#performance")
"https://kelteseth.gitlab.io/ScreenPlayDocs/wallpaper/wallpaper/#performance")
anchors { anchors {
bottom: parent.bottom bottom: parent.bottom
@ -142,7 +138,7 @@ Item {
highlighted: true highlighted: true
font.family: App.settings.font font.family: App.settings.font
onClicked: { onClicked: {
fileDialogImportVideo.open() fileDialogImportVideo.open();
} }
FileDialog { FileDialog {
@ -150,7 +146,7 @@ Item {
nameFilters: ["Video files (*.mp4)"] nameFilters: ["Video files (*.mp4)"]
onAccepted: { onAccepted: {
root.next(fileDialogImportVideo.currentFile) root.next(fileDialogImportVideo.currentFile);
} }
} }

View File

@ -53,7 +53,6 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
placeholderText: qsTr("Created By") placeholderText: qsTr("Created By")
} }
} }
Util.TextField { Util.TextField {
@ -83,7 +82,6 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
Item { Item {
@ -99,7 +97,5 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
} }

View File

@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls.Material import QtQuick.Controls.Material
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import ScreenPlayApp import ScreenPlayApp
import ScreenPlay import ScreenPlay
import ScreenPlayUtil as Util import ScreenPlayUtil as Util
@ -52,7 +51,6 @@ WizardPage {
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
} }
} }
Util.ImageSelector { Util.ImageSelector {
@ -60,7 +58,6 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
ColumnLayout { ColumnLayout {
@ -104,11 +101,7 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
} }
} }
} }

View File

@ -54,7 +54,6 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
placeholderText: qsTr("Created By") placeholderText: qsTr("Created By")
} }
} }
Util.TextField { Util.TextField {
@ -99,7 +98,5 @@ WizardPage {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
} }

View File

@ -15,11 +15,11 @@ FocusScope {
property alias savePopup: savePopup property alias savePopup: savePopup
property bool ready: false property bool ready: false
signal wizardStarted() signal wizardStarted
signal wizardExited() signal wizardExited
signal saveClicked() signal saveClicked
signal saveFinished() signal saveFinished
signal cancelClicked() signal cancelClicked
ScrollView { ScrollView {
contentWidth: width contentWidth: width
@ -45,9 +45,7 @@ FocusScope {
top: parent.top top: parent.top
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
} }
} }
RowLayout { RowLayout {
@ -80,7 +78,6 @@ FocusScope {
savePopup.open(); savePopup.open();
} }
} }
} }
Popup { Popup {
@ -108,7 +105,6 @@ FocusScope {
bottom: parent.bottom bottom: parent.bottom
bottomMargin: 30 bottomMargin: 30
} }
} }
Timer { Timer {
@ -120,7 +116,5 @@ FocusScope {
root.wizardExited(); root.wizardExited();
} }
} }
} }
} }

View File

@ -10,7 +10,6 @@ Rectangle {
implicitWidth: 1366 implicitWidth: 1366
implicitHeight: 768 implicitHeight: 768
Text { Text {
id: name id: name
text: qsTr("My ScreenPlay Wallpaper 🚀") text: qsTr("My ScreenPlay Wallpaper 🚀")

View File

@ -7,7 +7,7 @@ Item {
Rectangle { Rectangle {
id: background id: background
anchors.fill:parent anchors.fill: parent
opacity: 0.9 opacity: 0.9
color: "#333333" color: "#333333"
} }

View File

@ -25,24 +25,24 @@ Item {
function checkIsContentInstalled() { function checkIsContentInstalled() {
if (App.installedListModel.count === 0) { if (App.installedListModel.count === 0) {
loaderHelp.active = true loaderHelp.active = true;
gridView.footerItem.isVisible = true gridView.footerItem.isVisible = true;
gridView.visible = false gridView.visible = false;
navWrapper.visible = false navWrapper.visible = false;
} else { } else {
loaderHelp.active = false loaderHelp.active = false;
gridView.footerItem.isVisible = false gridView.footerItem.isVisible = false;
refresh = false refresh = false;
gridView.contentY = -82 gridView.contentY = -82;
gridView.visible = true gridView.visible = true;
navWrapper.visible = true navWrapper.visible = true;
} }
} }
Component.onCompleted: { Component.onCompleted: {
navWrapper.state = "in" navWrapper.state = "in";
App.installedListFilter.sortBySearchType(SearchType.All) App.installedListFilter.sortBySearchType(SearchType.All);
checkIsContentInstalled() checkIsContentInstalled();
} }
Action { Action {
@ -52,12 +52,12 @@ Item {
Connections { Connections {
function onInstalledLoadingFinished() { function onInstalledLoadingFinished() {
checkIsContentInstalled() checkIsContentInstalled();
} }
function onCountChanged(count) { function onCountChanged(count) {
if (count === 0) if (count === 0)
checkIsContentInstalled() checkIsContentInstalled();
} }
target: App.installedListModel target: App.installedListModel
@ -72,7 +72,7 @@ Item {
Connections { Connections {
function onSortChanged() { function onSortChanged() {
gridView.positionViewAtBeginning() gridView.positionViewAtBeginning();
} }
target: App.installedListFilter target: App.installedListFilter
@ -129,12 +129,12 @@ Item {
} }
onContentYChanged: { onContentYChanged: {
if (contentY <= -180) if (contentY <= -180)
gridView.headerItem.isVisible = true gridView.headerItem.isVisible = true;
else else
gridView.headerItem.isVisible = false gridView.headerItem.isVisible = false;
//Pull to refresh //Pull to refresh
if (contentY <= -180 && !refresh && !isDragging) if (contentY <= -180 && !refresh && !isDragging)
App.installedListModel.reset() App.installedListModel.reset();
} }
anchors { anchors {
@ -151,11 +151,11 @@ Item {
opacity: 0 opacity: 0
onIsVisibleChanged: { onIsVisibleChanged: {
if (isVisible) { if (isVisible) {
txtHeader.color = Material.accent txtHeader.color = Material.accent;
txtHeader.text = qsTr("Refreshing!") txtHeader.text = qsTr("Refreshing!");
} else { } else {
txtHeader.color = "gray" txtHeader.color = "gray";
txtHeader.text = qsTr("Pull to refresh!") txtHeader.text = qsTr("Pull to refresh!");
} }
} }
@ -163,7 +163,7 @@ Item {
interval: 150 interval: 150
running: true running: true
onTriggered: { onTriggered: {
animFadeIn.start() animFadeIn.start();
} }
} }
@ -177,7 +177,7 @@ Item {
font.pointSize: 18 font.pointSize: 18
} }
PropertyAnimation on opacity { PropertyAnimation on opacity {
id: animFadeIn id: animFadeIn
from: 0 from: 0
@ -207,11 +207,11 @@ Item {
interval: 400 interval: 400
running: true running: true
onTriggered: { onTriggered: {
animFadeInTxtFooter.start() animFadeInTxtFooter.start();
} }
} }
PropertyAnimation on opacity { PropertyAnimation on opacity {
id: animFadeInTxtFooter id: animFadeInTxtFooter
from: 0 from: 0
@ -236,16 +236,15 @@ Item {
isScrolling: gridView.isScrolling isScrolling: gridView.isScrolling
onOpenContextMenu: function (position) { onOpenContextMenu: function (position) {
// Set the menu to the current item informations // Set the menu to the current item informations
contextMenu.publishedFileID = delegate.publishedFileID contextMenu.publishedFileID = delegate.publishedFileID;
contextMenu.absoluteStoragePath = delegate.absoluteStoragePath contextMenu.absoluteStoragePath = delegate.absoluteStoragePath;
contextMenu.fileName = delegate.customTitle contextMenu.fileName = delegate.customTitle;
const pos = delegate.mapToItem(root, position.x, position.y) const pos = delegate.mapToItem(root, position.x, position.y);
// Disable duplicate opening. The can happen if we // Disable duplicate opening. The can happen if we
// call popup when we are in the closing animtion. // call popup when we are in the closing animtion.
if (contextMenu.visible || contextMenu.opened) if (contextMenu.visible || contextMenu.opened)
return return;
contextMenu.popup(pos.x, pos.y);
contextMenu.popup(pos.x, pos.y)
} }
} }
@ -267,7 +266,7 @@ Item {
objectName: "openFolder" objectName: "openFolder"
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_folder_open.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_folder_open.svg"
onClicked: { onClicked: {
App.util.openFolderInExplorer(contextMenu.absoluteStoragePath) App.util.openFolderInExplorer(contextMenu.absoluteStoragePath);
} }
} }
@ -276,13 +275,10 @@ Item {
objectName: enabled ? "removeItem" : "removeWorkshopItem" objectName: enabled ? "removeItem" : "removeWorkshopItem"
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_import_export_.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_import_export_.svg"
onClicked: { onClicked: {
exportFileDialog.absoluteStoragePath = contextMenu.absoluteStoragePath exportFileDialog.absoluteStoragePath = contextMenu.absoluteStoragePath;
let urlFileName = Labs.StandardPaths.writableLocation( let urlFileName = Labs.StandardPaths.writableLocation(Labs.StandardPaths.DesktopLocation) + "/" + contextMenu.fileName + ".screenplay";
Labs.StandardPaths.DesktopLocation) + "/" exportFileDialog.currentFile = urlFileName;
+ contextMenu.fileName + ".screenplay" exportFileDialog.open();
exportFileDialog.currentFile = urlFileName
exportFileDialog.open()
} }
} }
@ -290,21 +286,18 @@ Item {
text: enabled ? qsTr("Remove Item") : qsTr("Remove via Workshop") text: enabled ? qsTr("Remove Item") : qsTr("Remove via Workshop")
objectName: enabled ? "removeItem" : "removeWorkshopItem" objectName: enabled ? "removeItem" : "removeWorkshopItem"
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_delete.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_delete.svg"
enabled: contextMenu.publishedFileID === 0 enabled: contextMenu.publishedFileID === 0 || !App.settings.steamVersion
|| !App.settings.steamVersion
onClicked: { onClicked: {
deleteDialog.open() deleteDialog.open();
} }
} }
MenuItem { MenuItem {
text: qsTr("Open Workshop Page") text: qsTr("Open Workshop Page")
enabled: contextMenu.publishedFileID !== 0 enabled: contextMenu.publishedFileID !== 0 && App.settings.steamVersion
&& App.settings.steamVersion
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_steam.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_steam.svg"
onClicked: { onClicked: {
Qt.openUrlExternally( Qt.openUrlExternally("steam://url/CommunityFilePage/" + contextMenu.publishedFileID);
"steam://url/CommunityFilePage/" + contextMenu.publishedFileID)
} }
} }
} }
@ -317,9 +310,8 @@ Item {
modalSource: root.modalSource modalSource: root.modalSource
anchors.centerIn: Overlay.overlay anchors.centerIn: Overlay.overlay
onAccepted: { onAccepted: {
root.sidebar.clear() root.sidebar.clear();
App.installedListModel.deinstallItemAt( App.installedListModel.deinstallItemAt(contextMenu.absoluteStoragePath);
contextMenu.absoluteStoragePath)
} }
} }
@ -328,7 +320,7 @@ Item {
fileMode: FileDialog.SaveFile fileMode: FileDialog.SaveFile
property string absoluteStoragePath property string absoluteStoragePath
onAccepted: { onAccepted: {
exportFileProgressDialog.open() exportFileProgressDialog.open();
} }
} }
@ -341,9 +333,7 @@ Item {
modalSource: root.modalSource modalSource: root.modalSource
closePolicy: Popup.NoAutoClose closePolicy: Popup.NoAutoClose
onOpened: { onOpened: {
const success = App.util.exportProject( const success = App.util.exportProject(exportFileDialog.absoluteStoragePath, exportFileDialog.currentFile);
exportFileDialog.absoluteStoragePath,
exportFileDialog.currentFile)
} }
onClosed: exportProgressBar.value = 0 onClosed: exportProgressBar.value = 0
ColumnLayout { ColumnLayout {
@ -368,10 +358,10 @@ Item {
id: exportConnections id: exportConnections
target: App.util target: App.util
function onCompressionProgressChanged(file, proc, total, br, bt) { function onCompressionProgressChanged(file, proc, total, br, bt) {
exportProgressBar.value = (br * 100 / bt) exportProgressBar.value = (br * 100 / bt);
} }
function onCompressionFinished() { function onCompressionFinished() {
exportFileProgressDialog.close() exportFileProgressDialog.close();
} }
} }
} }
@ -391,31 +381,28 @@ Item {
anchors.fill: parent anchors.fill: parent
property string filePath property string filePath
onEntered: function (drag) { onEntered: function (drag) {
dropPopup.open() dropPopup.open();
} }
onDropped: function (drop) { onDropped: function (drop) {
dropPopup.close() dropPopup.close();
dropArea.enabled = false dropArea.enabled = false;
if (drop.urls.length > 1) { if (drop.urls.length > 1) {
importProjectErrorDialog.title = qsTr( importProjectErrorDialog.title = qsTr("We only support adding one item at once.");
"We only support adding one item at once.") importProjectErrorDialog.open();
importProjectErrorDialog.open() return;
return
} }
var file = "" // Convert url to string var file = ""; // Convert url to string
file = "" + drop.urls[0] file = "" + drop.urls[0];
if (!file.endsWith('.screenplay')) { if (!file.endsWith('.screenplay')) {
importProjectErrorDialog.title = qsTr( importProjectErrorDialog.title = qsTr("File type not supported. We only support '.screenplay' files.");
"File type not supported. We only support '.screenplay' files.") importProjectErrorDialog.open();
importProjectErrorDialog.open() return;
return
} }
importDialog.open() importDialog.open();
dropArea.filePath = file dropArea.filePath = file;
} }
onExited: { onExited: {
dropPopup.close() dropPopup.close();
} }
Util.Dialog { Util.Dialog {
@ -436,10 +423,9 @@ Item {
closePolicy: Popup.NoAutoClose closePolicy: Popup.NoAutoClose
onClosed: importProgressBar.value = 0 onClosed: importProgressBar.value = 0
onOpened: { onOpened: {
const success = App.util.importProject(dropArea.filePath, const success = App.util.importProject(dropArea.filePath, App.globalVariables.localStoragePath);
App.globalVariables.localStoragePath) print("finished", success);
print("finished", success) dropArea.filePath = "";
dropArea.filePath = ""
} }
ColumnLayout { ColumnLayout {
width: parent.width width: parent.width
@ -461,10 +447,10 @@ Item {
id: importConnections id: importConnections
target: App.util target: App.util
function onExtractionProgressChanged(file, proc, total, br, bt) { function onExtractionProgressChanged(file, proc, total, br, bt) {
importProgressBar.value = (br * 100 / bt) importProgressBar.value = (br * 100 / bt);
} }
function onExtractionFinished() { function onExtractionFinished() {
importDialog.close() importDialog.close();
} }
} }
} }
@ -480,8 +466,8 @@ Item {
modal: true modal: true
onOpened: fileDropAnimation.state = "fileDrop" onOpened: fileDropAnimation.state = "fileDrop"
onClosed: { onClosed: {
fileDropAnimation.state = "" fileDropAnimation.state = "";
dropArea.enabled = true dropArea.enabled = true;
} }
Util.FileDropAnimation { Util.FileDropAnimation {

View File

@ -33,7 +33,8 @@ Item {
} }
} }
Util.MouseHoverBlocker {} Util.MouseHoverBlocker {
}
Item { Item {
height: nav.height height: nav.height
@ -47,7 +48,8 @@ Item {
TabBar { TabBar {
height: parent.height height: parent.height
background: Item {} background: Item {
}
anchors { anchors {
top: parent.top top: parent.top
topMargin: 5 topMargin: 5
@ -56,21 +58,12 @@ Item {
bottom: parent.bottom bottom: parent.bottom
} }
component CustomTabButton: TabButton {
icon.height: 16
icon.width: 16
height: parent.height
width: implicitWidth
background: Item {}
font.capitalization: Font.MixedCase
}
CustomTabButton { CustomTabButton {
text: qsTr("All") text: qsTr("All")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_installed.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_installed.svg"
onClicked: { onClicked: {
setSidebarActive(false) setSidebarActive(false);
App.installedListFilter.sortBySearchType(SearchType.All) App.installedListFilter.sortBySearchType(SearchType.All);
} }
} }
@ -78,8 +71,8 @@ Item {
text: qsTr("Scenes") text: qsTr("Scenes")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_code.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_code.svg"
onClicked: { onClicked: {
setSidebarActive(false) setSidebarActive(false);
App.installedListFilter.sortBySearchType(SearchType.Scene) App.installedListFilter.sortBySearchType(SearchType.Scene);
} }
} }
@ -87,9 +80,8 @@ Item {
text: qsTr("Videos") text: qsTr("Videos")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_movie.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_movie.svg"
onClicked: { onClicked: {
setSidebarActive(false) setSidebarActive(false);
App.installedListFilter.sortBySearchType( App.installedListFilter.sortBySearchType(SearchType.Wallpaper);
SearchType.Wallpaper)
} }
} }
@ -97,8 +89,8 @@ Item {
text: qsTr("Widgets") text: qsTr("Widgets")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_widgets.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_widgets.svg"
onClicked: { onClicked: {
setSidebarActive(false) setSidebarActive(false);
App.installedListFilter.sortBySearchType(SearchType.Widget) App.installedListFilter.sortBySearchType(SearchType.Widget);
} }
} }
} }
@ -127,10 +119,8 @@ Item {
ToolTip.visible: hovered ToolTip.visible: hovered
ToolTip.text: (btnSortOrder.sortOrder === Qt.AscendingOrder) ? "Install Date Ascending" : "Install Date Descending" ToolTip.text: (btnSortOrder.sortOrder === Qt.AscendingOrder) ? "Install Date Ascending" : "Install Date Descending"
onClicked: { onClicked: {
btnSortOrder.sortOrder btnSortOrder.sortOrder = (btnSortOrder.sortOrder === Qt.DescendingOrder) ? Qt.AscendingOrder : Qt.DescendingOrder;
= (btnSortOrder.sortOrder App.installedListFilter.setSortOrder(btnSortOrder.sortOrder);
=== Qt.DescendingOrder) ? Qt.AscendingOrder : Qt.DescendingOrder
App.installedListFilter.setSortOrder(btnSortOrder.sortOrder)
} }
anchors { anchors {
@ -142,6 +132,16 @@ Item {
} }
} }
component CustomTabButton: TabButton {
icon.height: 16
icon.width: 16
height: parent.height
width: implicitWidth
background: Item {
}
font.capitalization: Font.MixedCase
}
states: [ states: [
State { State {
name: "out" name: "out"

View File

@ -70,8 +70,7 @@ Item {
id: txtHeadline id: txtHeadline
y: 80 y: 80
text: App.settings.steamVersion ? qsTr("Get free Widgets and Wallpaper via the Steam Workshop") : qsTr( text: App.settings.steamVersion ? qsTr("Get free Widgets and Wallpaper via the Steam Workshop") : qsTr("Get content via our forum")
"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
@ -106,9 +105,9 @@ Item {
text: { text: {
if (App.settings.steamVersion) { if (App.settings.steamVersion) {
return qsTr("Browse the Steam Workshop") return qsTr("Browse the Steam Workshop");
} else { } else {
return qsTr("Open the ScreenPlay forum") return qsTr("Open the ScreenPlay forum");
} }
} }
Material.background: Material.color(Material.Orange) Material.background: Material.color(Material.Orange)
@ -118,18 +117,18 @@ Item {
height: implicitHeight + 10 height: implicitHeight + 10
icon.source: { icon.source: {
if (App.settings.steamVersion) { if (App.settings.steamVersion) {
return "qrc:/qml/ScreenPlayApp/assets/icons/icon_steam.svg" return "qrc:/qml/ScreenPlayApp/assets/icons/icon_steam.svg";
} else { } else {
return "qrc:/qml/ScreenPlayApp/assets/icons/icon_community.svg" return "qrc:/qml/ScreenPlayApp/assets/icons/icon_community.svg";
} }
} }
icon.width: 18 icon.width: 18
icon.height: 18 icon.height: 18
onClicked: { onClicked: {
if (App.settings.steamVersion) { if (App.settings.steamVersion) {
App.util.setNavigation("Workshop") App.util.setNavigation("Workshop");
} else { } else {
Qt.openUrlExternally("https://forum.screen-play.app/") Qt.openUrlExternally("https://forum.screen-play.app/");
} }
} }
@ -312,7 +311,7 @@ Item {
ScriptAction { ScriptAction {
script: { script: {
animShake.start(2000, 1000, -1) animShake.start(2000, 1000, -1);
} }
} }
} }

View File

@ -25,16 +25,16 @@ Item {
height: 180 height: 180
onTypeChanged: { onTypeChanged: {
if (JSUtil.isWidget(type)) { if (JSUtil.isWidget(type)) {
icnType.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_widgets.svg" icnType.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_widgets.svg";
return return;
} }
if (JSUtil.isScene(type)) { if (JSUtil.isScene(type)) {
icnType.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_code.svg" icnType.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_code.svg";
return return;
} }
if (JSUtil.isVideo(type)) { if (JSUtil.isVideo(type)) {
icnType.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_movie.svg" icnType.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_movie.svg";
return return;
} }
} }
@ -42,11 +42,10 @@ Item {
running: true running: true
onTriggered: showAnim.start() onTriggered: showAnim.start()
interval: { interval: {
var itemIndexMax = itemIndex var itemIndexMax = itemIndex;
if (itemIndex > 30) if (itemIndex > 30)
itemIndexMax = 3 itemIndexMax = 3;
5 * itemIndexMax * Math.random();
5 * itemIndexMax * Math.random()
} }
} }
@ -215,20 +214,20 @@ Item {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
onEntered: { onEntered: {
root.state = "hover" root.state = "hover";
screenPlayItemImage.state = "hover" screenPlayItemImage.state = "hover";
screenPlayItemImage.enter() screenPlayItemImage.enter();
} }
onExited: { onExited: {
root.state = "" root.state = "";
screenPlayItemImage.state = "loaded" screenPlayItemImage.state = "loaded";
screenPlayItemImage.exit() screenPlayItemImage.exit();
} }
onClicked: function (mouse) { onClicked: function (mouse) {
if (mouse.button === Qt.LeftButton) if (mouse.button === Qt.LeftButton)
App.util.setSidebarItem(root.screenId, root.type) App.util.setSidebarItem(root.screenId, root.type);
else if (mouse.button === Qt.RightButton) else if (mouse.button === Qt.RightButton)
root.openContextMenu(Qt.point(mouseX, mouseY)) root.openContextMenu(Qt.point(mouseX, mouseY));
} }
} }
} }

View File

@ -11,7 +11,6 @@ Item {
function enter() { function enter() {
if (root.sourceImageGIF != "") if (root.sourceImageGIF != "")
loader_imgGIFPreview.sourceComponent = component_imgGIFPreview; loader_imgGIFPreview.sourceComponent = component_imgGIFPreview;
} }
function exit() { function exit() {
@ -33,7 +32,6 @@ Item {
source: { source: {
if (root.sourceImage === "") if (root.sourceImage === "")
return "qrc:/qml/ScreenPlayApp/assets/images/missingPreview.png"; return "qrc:/qml/ScreenPlayApp/assets/images/missingPreview.png";
return root.screenPreview === "" ? "qrc:/qml/ScreenPlayApp/assets/images/missingPreview.png" : Qt.resolvedUrl(absoluteStoragePath + "/" + root.sourceImage); return root.screenPreview === "" ? "qrc:/qml/ScreenPlayApp/assets/images/missingPreview.png" : Qt.resolvedUrl(absoluteStoragePath + "/" + root.sourceImage);
} }
onStatusChanged: { onStatusChanged: {
@ -57,7 +55,6 @@ Item {
source: root.sourceImageGIF === "" ? "qrc:/qml/ScreenPlayApp/assets/images/missingPreview.png" : Qt.resolvedUrl(absoluteStoragePath + "/" + root.sourceImageGIF) source: root.sourceImageGIF === "" ? "qrc:/qml/ScreenPlayApp/assets/images/missingPreview.png" : Qt.resolvedUrl(absoluteStoragePath + "/" + root.sourceImageGIF)
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
} }
} }
Loader { Loader {
@ -79,7 +76,6 @@ Item {
to: 1 to: 1
easing.type: Easing.OutQuart easing.type: Easing.OutQuart
} }
}, },
Transition { Transition {
from: "hover" from: "hover"
@ -92,7 +88,6 @@ Item {
to: 0 to: 0
easing.type: Easing.OutQuart easing.type: Easing.OutQuart
} }
}, },
Transition { Transition {
from: "loaded" from: "loaded"
@ -106,7 +101,6 @@ Item {
to: 1 to: 1
easing.type: Easing.OutQuart easing.type: Easing.OutQuart
} }
} }
] ]
} }

View File

@ -20,83 +20,70 @@ Item {
function indexOfValue(model, value) { function indexOfValue(model, value) {
for (var i = 0; i < model.length; i++) { for (var i = 0; i < model.length; i++) {
let ourValue = model[i].value let ourValue = model[i].value;
if (value === ourValue) if (value === ourValue)
return i return i;
} }
return -1 return -1;
} }
// This is used for removing wallpaper. We need to clear // This is used for removing wallpaper. We need to clear
// the preview image/gif so we can release the file for deletion. // the preview image/gif so we can release the file for deletion.
function clear() { function clear() {
imagePreview.source = "" imagePreview.source = "";
animatedImagePreview.source = "" animatedImagePreview.source = "";
txtHeadline.text = "" txtHeadline.text = "";
root.state = "inactive" root.state = "inactive";
} }
width: 400 width: 400
state: "inactive" state: "inactive"
property bool hasPreviewGif: false property bool hasPreviewGif: false
onContentFolderNameChanged: { onContentFolderNameChanged: {
txtHeadline.text = App.installedListModel.get( txtHeadline.text = App.installedListModel.get(root.contentFolderName).m_title;
root.contentFolderName).m_title const previewGiFilePath = Qt.resolvedUrl(App.globalVariables.localStoragePath + "/" + root.contentFolderName + "/" + App.installedListModel.get(root.contentFolderName).m_previewGIF);
const previewImageFilePath = Qt.resolvedUrl(App.globalVariables.localStoragePath + "/" + root.contentFolderName + "/" + App.installedListModel.get(root.contentFolderName).m_preview);
const previewGiFilePath = Qt.resolvedUrl( root.hasPreviewGif = App.util.fileExists(previewGiFilePath);
App.globalVariables.localStoragePath + "/"
+ root.contentFolderName + "/" + App.installedListModel.get(
root.contentFolderName).m_previewGIF)
const previewImageFilePath = Qt.resolvedUrl(
App.globalVariables.localStoragePath + "/"
+ root.contentFolderName + "/" + App.installedListModel.get(
root.contentFolderName).m_preview)
root.hasPreviewGif = App.util.fileExists(previewGiFilePath)
if (hasPreviewGif) { if (hasPreviewGif) {
animatedImagePreview.source = previewGiFilePath animatedImagePreview.source = previewGiFilePath;
animatedImagePreview.playing = true animatedImagePreview.playing = true;
} else { } else {
imagePreview.source = previewImageFilePath imagePreview.source = previewImageFilePath;
} }
if (JSUtil.isWidget(root.type) || (monitorSelection.activeMonitors.length > 0)) {
if (JSUtil.isWidget(root.type) btnSetWallpaper.enabled = true;
|| (monitorSelection.activeMonitors.length > 0)) { return;
btnSetWallpaper.enabled = true
return
} }
btnSetWallpaper.enabled = false btnSetWallpaper.enabled = false;
} }
Connections { Connections {
function onSetSidebarItem(folderName, type) { function onSetSidebarItem(folderName, type) {
// Toggle sidebar if clicked on the same content twice // Toggle sidebar if clicked on the same content twice
if (root.contentFolderName === folderName if (root.contentFolderName === folderName && root.state !== "inactive") {
&& root.state !== "inactive") { root.state = "inactive";
root.state = "inactive" return;
return
} }
root.contentFolderName = folderName root.contentFolderName = folderName;
root.type = type root.type = type;
if (JSUtil.isWallpaper(root.type)) { if (JSUtil.isWallpaper(root.type)) {
if (type === InstalledType.VideoWallpaper) if (type === InstalledType.VideoWallpaper)
root.state = "activeWallpaper" root.state = "activeWallpaper";
else else
root.state = "activeScene" root.state = "activeScene";
btnSetWallpaper.text = qsTr("Set Wallpaper") btnSetWallpaper.text = qsTr("Set Wallpaper");
} else { } else {
root.state = "activeWidget" root.state = "activeWidget";
btnSetWallpaper.text = qsTr("Set Widget") btnSetWallpaper.text = qsTr("Set Widget");
} }
} }
target: App.util target: App.util
} }
Util.MouseHoverBlocker {} Util.MouseHoverBlocker {
}
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
@ -350,9 +337,7 @@ Item {
"text": qsTr("Scale-Down") "text": qsTr("Scale-Down")
}] }]
Component.onCompleted: { Component.onCompleted: {
cbVideoFillMode.currentIndex = root.indexOfValue( cbVideoFillMode.currentIndex = root.indexOfValue(cbVideoFillMode.model, App.settings.videoFillMode);
cbVideoFillMode.model,
App.settings.videoFillMode)
} }
} }
} }
@ -361,47 +346,32 @@ Item {
Button { Button {
id: btnSetWallpaper id: btnSetWallpaper
objectName: "btnSetWallpaper" objectName: "btnSetWallpaper"
enabled: JSUtil.isWidget( enabled: JSUtil.isWidget(root.type) ? true : monitorSelection.isSelected
root.type) ? true : monitorSelection.isSelected
Material.background: Material.accent Material.background: Material.accent
Material.foreground: "white" Material.foreground: "white"
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_plus.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_plus.svg"
icon.color: "white" icon.color: "white"
font.pointSize: 12 font.pointSize: 12
onClicked: { onClicked: {
const absoluteStoragePath = App.globalVariables.localStoragePath const absoluteStoragePath = App.globalVariables.localStoragePath + "/" + root.contentFolderName;
+ "/" + root.contentFolderName const previewImage = App.installedListModel.get(root.contentFolderName).m_preview;
const previewImage = App.installedListModel.get(
root.contentFolderName).m_preview
if (JSUtil.isWallpaper(root.type)) { if (JSUtil.isWallpaper(root.type)) {
let activeMonitors = monitorSelection.getActiveMonitors( let activeMonitors = monitorSelection.getActiveMonitors();
)
// TODO Alert user to choose a monitor // TODO Alert user to choose a monitor
if (activeMonitors.length === 0) if (activeMonitors.length === 0)
return return;
// We only have sliderVolume if it is a VideoWallpaper // We only have sliderVolume if it is a VideoWallpaper
let volume = 0 let volume = 0;
if (type === InstalledType.VideoWallpaper) if (type === InstalledType.VideoWallpaper)
volume = Math.round( volume = Math.round(sliderVolume.slider.value * 100) / 100;
sliderVolume.slider.value * 100) / 100 const screenFile = App.installedListModel.get(root.contentFolderName).m_file;
let success = App.screenPlayManager.createWallpaper(root.type, cbVideoFillMode.currentValue, absoluteStoragePath, previewImage, screenFile, activeMonitors, volume, 1, {}, true);
const screenFile = App.installedListModel.get(
root.contentFolderName).m_file
let success = App.screenPlayManager.createWallpaper(
root.type, cbVideoFillMode.currentValue,
absoluteStoragePath, previewImage, screenFile,
activeMonitors, volume, 1, {}, true)
} }
if (JSUtil.isWidget(root.type)) if (JSUtil.isWidget(root.type))
App.screenPlayManager.createWidget(type, App.screenPlayManager.createWidget(type, Qt.point(0, 0), absoluteStoragePath, previewImage, {}, true);
Qt.point(0, 0), root.state = "inactive";
absoluteStoragePath, monitorSelection.reset();
previewImage, {},
true)
root.state = "inactive"
monitorSelection.reset()
} }
anchors { anchors {

View File

@ -19,7 +19,6 @@ ColumnLayout {
let ourValue = model[i].value; let ourValue = model[i].value;
if (value === ourValue) if (value === ourValue)
return i; return i;
} }
return -1; return -1;
} }
@ -44,7 +43,6 @@ ColumnLayout {
} }
} }
Util.Slider { Util.Slider {
id: slCurrentVideoTime id: slCurrentVideoTime
@ -83,23 +81,23 @@ ColumnLayout {
valueRole: "value" valueRole: "value"
currentIndex: root.indexOfValue(settingsComboBox.model, App.settings.videoFillMode) currentIndex: root.indexOfValue(settingsComboBox.model, App.settings.videoFillMode)
model: [{ model: [{
"value": FillMode.Stretch, "value": FillMode.Stretch,
"text": qsTr("Stretch") "text": qsTr("Stretch")
}, { }, {
"value": FillMode.Fill, "value": FillMode.Fill,
"text": qsTr("Fill") "text": qsTr("Fill")
}, { }, {
"value": FillMode.Contain, "value": FillMode.Contain,
"text": qsTr("Contain") "text": qsTr("Contain")
}, { }, {
"value": FillMode.Cover, "value": FillMode.Cover,
"text": qsTr("Cover") "text": qsTr("Cover")
}, { }, {
"value": FillMode.Scale_Down, "value": FillMode.Scale_Down,
"text": qsTr("Scale_Down") "text": qsTr("Scale_Down")
}] }]
onActivated: { onActivated: {
App.screenPlayManager.setWallpaperFillModeAtMonitorIndex(activeMonitorIndex,settingsComboBox.currentValue); App.screenPlayManager.setWallpaperFillModeAtMonitorIndex(activeMonitorIndex, settingsComboBox.currentValue);
} }
} }
@ -107,7 +105,6 @@ ColumnLayout {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
states: [ states: [
@ -119,7 +116,6 @@ ColumnLayout {
opacity: 1 opacity: 1
anchors.topMargin: 20 anchors.topMargin: 20
} }
}, },
State { State {
name: "hidden" name: "hidden"
@ -129,7 +125,6 @@ ColumnLayout {
opacity: 0 opacity: 0
anchors.topMargin: -50 anchors.topMargin: -50
} }
} }
] ]
transitions: [ transitions: [
@ -144,7 +139,6 @@ ColumnLayout {
easing.type: Easing.InOutQuart easing.type: Easing.InOutQuart
properties: "anchors.topMargin, opacity" properties: "anchors.topMargin, opacity"
} }
} }
] ]
} }

View File

@ -20,9 +20,8 @@ Rectangle {
property alias radius: root.radius property alias radius: root.radius
Component.onCompleted: { Component.onCompleted: {
resize() resize();
selectOnly(0) selectOnly(0);
} }
signal requestProjectSettings(var index, var installedType, var appID) signal requestProjectSettings(var index, var installedType, var appID)
@ -30,87 +29,84 @@ Rectangle {
function selectOnly(index) { function selectOnly(index) {
for (var i = 0; i < rp.count; i++) { for (var i = 0; i < rp.count; i++) {
if (i === index) { if (i === index) {
rp.itemAt(i).isSelected = true rp.itemAt(i).isSelected = true;
continue continue;
} }
rp.itemAt(i).isSelected = false rp.itemAt(i).isSelected = false;
} }
getActiveMonitors() getActiveMonitors();
} }
function reset() { function reset() {
for (var i = 0; i < rp.count; i++) { for (var i = 0; i < rp.count; i++) {
rp.itemAt(i).isSelected = false rp.itemAt(i).isSelected = false;
} }
rp.itemAt(0).isSelected = true rp.itemAt(0).isSelected = true;
getActiveMonitors() getActiveMonitors();
} }
function getActiveMonitors() { function getActiveMonitors() {
root.activeMonitors = [] root.activeMonitors = [];
for (var i = 0; i < rp.count; i++) { for (var i = 0; i < rp.count; i++) {
if (rp.itemAt(i).isSelected) if (rp.itemAt(i).isSelected)
root.activeMonitors.push(rp.itemAt(i).index) root.activeMonitors.push(rp.itemAt(i).index);
} }
// Must be called manually. When QML properties are getting altered in js the // Must be called manually. When QML properties are getting altered in js the
// property binding breaks // property binding breaks
root.activeMonitorsChanged() root.activeMonitorsChanged();
root.isSelected = root.activeMonitors.length > 0 root.isSelected = root.activeMonitors.length > 0;
return root.activeMonitors return root.activeMonitors;
} }
function selectMonitorAt(index) { function selectMonitorAt(index) {
if (!multipleMonitorsSelectable) if (!multipleMonitorsSelectable)
selectOnly(index) selectOnly(index);
else else
rp.itemAt(index).isSelected = !rp.itemAt(index).isSelected rp.itemAt(index).isSelected = !rp.itemAt(index).isSelected;
getActiveMonitors() getActiveMonitors();
if (rp.itemAt(index).hasContent) if (rp.itemAt(index).hasContent)
root.requestProjectSettings(index, rp.itemAt(index).installedType, root.requestProjectSettings(index, rp.itemAt(index).installedType, rp.itemAt(index).appID);
rp.itemAt(index).appID)
} }
function resize() { function resize() {
var absoluteDesktopSize = App.monitorListModel.absoluteDesktopSize() var absoluteDesktopSize = App.monitorListModel.absoluteDesktopSize();
var isWidthGreaterThanHeight = false var isWidthGreaterThanHeight = false;
var windowsDelta = 0 var windowsDelta = 0;
if (absoluteDesktopSize.width < absoluteDesktopSize.height) { if (absoluteDesktopSize.width < absoluteDesktopSize.height) {
windowsDelta = absoluteDesktopSize.width / absoluteDesktopSize.height windowsDelta = absoluteDesktopSize.width / absoluteDesktopSize.height;
isWidthGreaterThanHeight = false isWidthGreaterThanHeight = false;
} else { } else {
windowsDelta = absoluteDesktopSize.height / absoluteDesktopSize.width windowsDelta = absoluteDesktopSize.height / absoluteDesktopSize.width;
isWidthGreaterThanHeight = true isWidthGreaterThanHeight = true;
} }
if (rp.count === 1) if (rp.count === 1)
availableWidth = availableWidth * 0.66 availableWidth = availableWidth * 0.66;
var dynamicHeight = availableWidth * windowsDelta;
var dynamicHeight = availableWidth * windowsDelta var dynamicWidth = availableHeight * windowsDelta;
var dynamicWidth = availableHeight * windowsDelta
// Delta (height/width) // Delta (height/width)
var monitorHeightRationDelta = 0 var monitorHeightRationDelta = 0;
var monitorWidthRationDelta = 0 var monitorWidthRationDelta = 0;
if (isWidthGreaterThanHeight) { if (isWidthGreaterThanHeight) {
monitorHeightRationDelta = dynamicHeight / absoluteDesktopSize.height monitorHeightRationDelta = dynamicHeight / absoluteDesktopSize.height;
monitorWidthRationDelta = availableWidth / absoluteDesktopSize.width monitorWidthRationDelta = availableWidth / absoluteDesktopSize.width;
} else { } else {
monitorHeightRationDelta = availableHeight / absoluteDesktopSize.height monitorHeightRationDelta = availableHeight / absoluteDesktopSize.height;
monitorWidthRationDelta = dynamicWidth / absoluteDesktopSize.width monitorWidthRationDelta = dynamicWidth / absoluteDesktopSize.width;
} }
for (var i = 0; i < rp.count; i++) { for (var i = 0; i < rp.count; i++) {
rp.itemAt(i).index = i rp.itemAt(i).index = i;
rp.itemAt(i).height = rp.itemAt(i).height * monitorHeightRationDelta rp.itemAt(i).height = rp.itemAt(i).height * monitorHeightRationDelta;
rp.itemAt(i).width = rp.itemAt(i).width * monitorWidthRationDelta rp.itemAt(i).width = rp.itemAt(i).width * monitorWidthRationDelta;
rp.itemAt(i).x = rp.itemAt(i).x * monitorWidthRationDelta rp.itemAt(i).x = rp.itemAt(i).x * monitorWidthRationDelta;
rp.itemAt(i).y = rp.itemAt(i).y * monitorHeightRationDelta rp.itemAt(i).y = rp.itemAt(i).y * monitorHeightRationDelta;
rp.contentWidth += rp.itemAt(i).width rp.contentWidth += rp.itemAt(i).width;
rp.contentHeight += rp.itemAt(i).height rp.contentHeight += rp.itemAt(i).height;
} }
rp.contentWidth += 200 rp.contentWidth += 200;
rp.contentHeight += 200 rp.contentHeight += 200;
} }
color: Material.theme === Material.Light ? Material.background : Qt.darker( color: Material.theme === Material.Light ? Material.background : Qt.darker(Material.background)
Material.background)
height: availableHeight height: availableHeight
width: parent.width width: parent.width
clip: true clip: true
@ -118,7 +114,7 @@ Rectangle {
Connections { Connections {
function onMonitorReloadCompleted() { function onMonitorReloadCompleted() {
resize() resize();
} }
target: App.monitorListModel target: App.monitorListModel
@ -150,7 +146,7 @@ Rectangle {
installedType: m_installedType installedType: m_installedType
monitorWithoutContentSelectable: root.monitorWithoutContentSelectable monitorWithoutContentSelectable: root.monitorWithoutContentSelectable
onMonitorSelected: function (index) { onMonitorSelected: function (index) {
root.selectMonitorAt(index) root.selectMonitorAt(index);
} }
} }
} }

View File

@ -10,10 +10,10 @@ Item {
property rect geometry property rect geometry
onGeometryChanged: { onGeometryChanged: {
root.width = geometry.width root.width = geometry.width;
root.height = geometry.height root.height = geometry.height;
root.x = geometry.x root.x = geometry.x;
root.y = geometry.y root.y = geometry.y;
} }
property string previewImage property string previewImage
@ -51,7 +51,6 @@ Item {
top: wrapper.bottom top: wrapper.bottom
topMargin: 5 topMargin: 5
} }
} }
Rectangle { Rectangle {
@ -83,14 +82,12 @@ Item {
onClicked: { onClicked: {
if (monitorWithoutContentSelectable) { if (monitorWithoutContentSelectable) {
monitorSelected(index); monitorSelected(index);
return return;
} }
if (root.hasContent && !root.monitorWithoutContentSelectable) if (root.hasContent && !root.monitorWithoutContentSelectable)
monitorSelected(index); monitorSelected(index);
} }
} }
} }
states: [ states: [
@ -101,7 +98,6 @@ Item {
target: wrapper target: wrapper
border.color: "#373737" border.color: "#373737"
} }
}, },
State { State {
name: "selected" name: "selected"
@ -110,7 +106,6 @@ Item {
target: wrapper target: wrapper
border.color: "#F28E0D" border.color: "#F28E0D"
} }
} }
] ]
transitions: [ transitions: [
@ -125,7 +120,6 @@ Item {
easing.type: Easing.InOutQuart easing.type: Easing.InOutQuart
property: "border.color" property: "border.color"
} }
} }
] ]
} }

View File

@ -18,12 +18,12 @@ Util.Popup {
width: 1000 width: 1000
height: 500 height: 500
onOpened: { onOpened: {
monitorSelection.selectMonitorAt(0) monitorSelection.selectMonitorAt(0);
} }
Connections { Connections {
function onRequestToggleWallpaperConfiguration() { function onRequestToggleWallpaperConfiguration() {
root.open() root.open();
} }
target: App.util target: App.util
@ -81,21 +81,18 @@ Util.Popup {
availableHeight: 150 availableHeight: 150
onRequestProjectSettings: function (index, installedType, appID) { onRequestProjectSettings: function (index, installedType, appID) {
if (installedType === InstalledType.VideoWallpaper) { if (installedType === InstalledType.VideoWallpaper) {
videoControlWrapper.state = "visible" videoControlWrapper.state = "visible";
customPropertiesGridView.visible = false customPropertiesGridView.visible = false;
const wallpaper = App.screenPlayManager.getWallpaperByAppID( const wallpaper = App.screenPlayManager.getWallpaperByAppID(appID);
appID) videoControlWrapper.wallpaper = wallpaper;
videoControlWrapper.wallpaper = wallpaper
} else { } else {
videoControlWrapper.state = "hidden" videoControlWrapper.state = "hidden";
customPropertiesGridView.visible = true customPropertiesGridView.visible = true;
if (!App.screenPlayManager.requestProjectSettingsAtMonitorIndex( if (!App.screenPlayManager.requestProjectSettingsAtMonitorIndex(index)) {
index)) { console.warn("Unable to get requested settings from index: ", index);
console.warn("Unable to get requested settings from index: ",
index)
} }
} }
activeMonitorIndex = index activeMonitorIndex = index;
} }
anchors { anchors {
@ -107,7 +104,7 @@ Util.Popup {
Connections { Connections {
function onProjectSettingsListModelResult(listModel) { function onProjectSettingsListModelResult(listModel) {
customPropertiesGridView.projectSettingsListmodelRef = listModel customPropertiesGridView.projectSettingsListmodelRef = listModel;
} }
target: App.screenPlayManager target: App.screenPlayManager
@ -130,39 +127,32 @@ Util.Popup {
highlighted: true highlighted: true
text: qsTr("Remove selected") text: qsTr("Remove selected")
font.family: App.settings.font font.family: App.settings.font
enabled: monitorSelection.activeMonitors.length == 1 enabled: monitorSelection.activeMonitors.length == 1 && App.screenPlayManager.activeWallpaperCounter > 0
&& App.screenPlayManager.activeWallpaperCounter > 0
onClicked: { onClicked: {
if (!App.screenPlayManager.removeWallpaperAt( if (!App.screenPlayManager.removeWallpaperAt(monitorSelection.activeMonitors[0]))
monitorSelection.activeMonitors[0])) print("Unable to close singel wallpaper");
print("Unable to close singel wallpaper")
} }
} }
Button { Button {
id: btnRemoveAllWallpape id: btnRemoveAllWallpape
text: qsTr("Remove all ") text: qsTr("Remove all ") + App.screenPlayManager.activeWallpaperCounter + " " + qsTr("Wallpapers")
+ App.screenPlayManager.activeWallpaperCounter + " " + qsTr(
"Wallpapers")
Material.background: Material.accent Material.background: Material.accent
highlighted: true highlighted: true
font.family: App.settings.font font.family: App.settings.font
enabled: App.screenPlayManager.activeWallpaperCounter > 0 enabled: App.screenPlayManager.activeWallpaperCounter > 0
onClicked: { onClicked: {
if (!App.screenPlayManager.removeAllWallpapers()) if (!App.screenPlayManager.removeAllWallpapers())
print("Unable to close all wallpaper!") print("Unable to close all wallpaper!");
root.close();
root.close()
} }
} }
Button { Button {
id: btnRemoveAllWidgets id: btnRemoveAllWidgets
text: qsTr("Remove all ") text: qsTr("Remove all ") + App.screenPlayManager.activeWidgetsCounter + " " + qsTr("Widgets")
+ App.screenPlayManager.activeWidgetsCounter + " " + qsTr(
"Widgets")
Material.background: Material.accent Material.background: Material.accent
Material.foreground: Material.primaryTextColor Material.foreground: Material.primaryTextColor
highlighted: true highlighted: true
@ -170,17 +160,15 @@ Util.Popup {
enabled: App.screenPlayManager.activeWidgetsCounter > 0 enabled: App.screenPlayManager.activeWidgetsCounter > 0
onClicked: { onClicked: {
if (!App.screenPlayManager.removeAllWidgets()) if (!App.screenPlayManager.removeAllWidgets())
print("Unable to close all widgets!") print("Unable to close all widgets!");
root.close();
root.close()
} }
} }
} }
} }
Rectangle { Rectangle {
color: Material.theme === Material.Light ? Material.background : Qt.darker( color: Material.theme === Material.Light ? Material.background : Qt.darker(Material.background)
Material.background)
radius: 3 radius: 3
clip: true clip: true
@ -262,7 +250,7 @@ Util.Popup {
Connections { Connections {
function onProfilesSaved() { function onProfilesSaved() {
if (root.opened) if (root.opened)
saveNotification.open() saveNotification.open();
} }
target: App.screenPlayManager target: App.screenPlayManager

View File

@ -35,7 +35,6 @@ Item {
left: parent.left left: parent.left
leftMargin: root.isHeadline ? 0 : 25 leftMargin: root.isHeadline ? 0 : 25
} }
} }
Item { Item {
@ -43,8 +42,7 @@ Item {
visible: !root.isHeadline visible: !root.isHeadline
Component.onCompleted: { Component.onCompleted: {
if (root.isHeadline) if (root.isHeadline)
return ; return;
switch (root.value["type"]) { switch (root.value["type"]) {
case "slider": case "slider":
loader.sourceComponent = compSlider; loader.sourceComponent = compSlider;
@ -64,7 +62,6 @@ Item {
} }
if (root.value["text"]) if (root.value["text"])
txtDescription.text = root.value["text"]; txtDescription.text = root.value["text"];
} }
anchors { anchors {
@ -86,7 +83,6 @@ Item {
target: loader.item target: loader.item
} }
} }
Component { Component {
@ -119,11 +115,8 @@ Item {
right: parent.right right: parent.right
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
} }
} }
Component { Component {
@ -148,7 +141,6 @@ Item {
right: parent.right right: parent.right
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
Rectangle { Rectangle {
@ -166,7 +158,6 @@ Item {
rightMargin: 20 rightMargin: 20
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
ColorDialog { ColorDialog {
@ -184,9 +175,7 @@ Item {
App.screenPlayManager.setWallpaperValueAtMonitorIndex(selectedMonitor, name, tmpColor); App.screenPlayManager.setWallpaperValueAtMonitorIndex(selectedMonitor, name, tmpColor);
} }
} }
} }
} }
Component { Component {
@ -233,7 +222,6 @@ Item {
left: parent.left left: parent.left
leftMargin: 20 leftMargin: 20
} }
} }
Text { Text {
@ -247,13 +235,8 @@ Item {
right: parent.right right: parent.right
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
} }
} }
} }
} }

View File

@ -51,7 +51,6 @@ Rectangle {
bottom: parent.bottom bottom: parent.bottom
bottomMargin: 5 bottomMargin: 5
} }
} }
layer.effect: ElevationEffect { layer.effect: ElevationEffect {
@ -70,7 +69,6 @@ Rectangle {
duration: 250 duration: 250
easing.type: Easing.InOutQuart easing.type: Easing.InOutQuart
} }
} }
] ]
states: [ states: [
@ -82,7 +80,6 @@ Rectangle {
anchors.bottomMargin: 10 anchors.bottomMargin: 10
opacity: 1 opacity: 1
} }
} }
] ]
} }

View File

@ -9,7 +9,6 @@ import ScreenPlay
import ScreenPlayUtil as Util import ScreenPlayUtil as Util
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
/*! /*!
\qmltype exitDialog \qmltype exitDialog
\brief exitDialog \brief exitDialog
@ -46,10 +45,10 @@ Util.Popup {
Text { Text {
text: { text: {
if (Qt.platform.os === "windows") { if (Qt.platform.os === "windows") {
return qsTr("You can <b>quit</b> ScreenPlay via the bottom right Tray-Icon.") return qsTr("You can <b>quit</b> ScreenPlay via the bottom right Tray-Icon.");
} }
if (Qt.platform.os === "osx") { if (Qt.platform.os === "osx") {
return qsTr("You can <b>quit</b> ScreenPlay via the top right Tray-Icon.") return qsTr("You can <b>quit</b> ScreenPlay via the top right Tray-Icon.");
} }
} }
@ -75,20 +74,20 @@ Util.Popup {
Button { Button {
text: qsTr("Minimize ScreenPlay") text: qsTr("Minimize ScreenPlay")
onClicked: { onClicked: {
applicationWindow.hide() applicationWindow.hide();
App.showDockIcon(false) App.showDockIcon(false);
root.close() root.close();
} }
} }
Button { Button {
highlighted: true highlighted: true
text: qsTr("Always minimize ScreenPlay") text: qsTr("Always minimize ScreenPlay")
onClicked: { onClicked: {
settings.setValue("alwaysMinimize", true) settings.setValue("alwaysMinimize", true);
settings.sync() settings.sync();
App.showDockIcon(false) App.showDockIcon(false);
applicationWindow.hide() applicationWindow.hide();
root.close() root.close();
} }
} }
} }

View File

@ -22,31 +22,30 @@ Rectangle {
signal changePage(string name) signal changePage(string name)
function setActive(active) { function setActive(active) {
navActive = active navActive = active;
if (active) if (active)
root.state = "enabled" root.state = "enabled";
else else
root.state = "disabled" root.state = "disabled";
} }
function setNavigation(name) { function setNavigation(name) {
var i = 0 var i = 0;
for (; i < navArray.length; i++) { for (; i < navArray.length; i++) {
if (navArray[i].name === name) { if (navArray[i].name === name) {
navArray[i].state = "active" navArray[i].state = "active";
root.currentNavigationName = name root.currentNavigationName = name;
} else { } else {
navArray[i].state = "inactive" navArray[i].state = "inactive";
} }
} }
} }
function onPageChanged(name) { function onPageChanged(name) {
if (!navActive) if (!navActive)
return return;
root.changePage(name);
root.changePage(name) setNavigation(name);
setNavigation(name)
} }
implicitWidth: 1366 implicitWidth: 1366
@ -60,11 +59,11 @@ Rectangle {
Connections { Connections {
function onRequestNavigationActive(isActive) { function onRequestNavigationActive(isActive) {
setActive(isActive) setActive(isActive);
} }
function onRequestNavigation(nav) { function onRequestNavigation(nav) {
onPageChanged(nav) onPageChanged(nav);
} }
target: App.util target: App.util
@ -83,16 +82,6 @@ Rectangle {
spacing: 0 spacing: 0
component CustomTabButton: TabButton {
icon.height: 16
icon.width: 16
font.pointSize: 12
height: parent.height
width: implicitWidth
background: Item {}
font.capitalization: Font.MixedCase
}
CustomTabButton { CustomTabButton {
id: navCreate id: navCreate
icon.height: 22 icon.height: 22
@ -100,7 +89,7 @@ Rectangle {
text: qsTr("Create") text: qsTr("Create")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_plus.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_plus.svg"
onClicked: { onClicked: {
root.onPageChanged("Create") root.onPageChanged("Create");
} }
objectName: "createTab" objectName: "createTab"
} }
@ -111,7 +100,7 @@ Rectangle {
text: qsTr("Workshop") text: qsTr("Workshop")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_steam.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_steam.svg"
onClicked: { onClicked: {
root.onPageChanged("Workshop") root.onPageChanged("Workshop");
} }
objectName: "workshopTab" objectName: "workshopTab"
} }
@ -121,7 +110,7 @@ Rectangle {
text: qsTr("Installed") + " " + App.installedListModel.count text: qsTr("Installed") + " " + App.installedListModel.count
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_installed.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_installed.svg"
onClicked: { onClicked: {
root.onPageChanged("Installed") root.onPageChanged("Installed");
} }
objectName: "installedTab" objectName: "installedTab"
} }
@ -131,7 +120,7 @@ Rectangle {
text: qsTr("Community") text: qsTr("Community")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_community.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_community.svg"
onClicked: { onClicked: {
root.onPageChanged("Community") root.onPageChanged("Community");
} }
objectName: "communityTab" objectName: "communityTab"
} }
@ -141,20 +130,30 @@ Rectangle {
text: qsTr("Settings") text: qsTr("Settings")
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_settings.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_settings.svg"
onClicked: { onClicked: {
root.onPageChanged("Settings") root.onPageChanged("Settings");
} }
objectName: "settingsTab" objectName: "settingsTab"
} }
} }
component CustomTabButton: TabButton {
icon.height: 16
icon.width: 16
font.pointSize: 12
height: parent.height
width: implicitWidth
background: Item {
}
font.capitalization: Font.MixedCase
}
Rectangle { Rectangle {
id: quickActionRowBackground id: quickActionRowBackground
anchors.centerIn: quickActionRow anchors.centerIn: quickActionRow
width: quickActionRow.width + 5 width: quickActionRow.width + 5
height: quickActionRow.height - 16 height: quickActionRow.height - 16
color: Material.theme === Material.Light ? Material.background : "#242424" color: Material.theme === Material.Light ? Material.background : "#242424"
border.color: Material.theme === Material.Light ? Material.iconDisabledColor : Qt.darker( border.color: Material.theme === Material.Light ? Material.iconDisabledColor : Qt.darker(Material.background)
Material.background)
border.width: 1 border.width: 1
radius: 3 radius: 3
} }
@ -170,8 +169,7 @@ Rectangle {
ToolButton { ToolButton {
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/font-awsome/patreon-brands.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/font-awsome/patreon-brands.svg"
text: qsTr("Support me on Patreon!") text: qsTr("Support me on Patreon!")
onClicked: Qt.openUrlExternally( onClicked: Qt.openUrlExternally("https://www.patreon.com/ScreenPlayApp")
"https://www.patreon.com/ScreenPlayApp")
} }
} }
@ -184,13 +182,12 @@ Rectangle {
bottom: parent.bottom bottom: parent.bottom
} }
property bool contentActive: App.screenPlayManager.activeWallpaperCounter > 0 property bool contentActive: App.screenPlayManager.activeWallpaperCounter > 0 || App.screenPlayManager.activeWidgetsCounter > 0
|| App.screenPlayManager.activeWidgetsCounter > 0
onContentActiveChanged: { onContentActiveChanged: {
if (!contentActive) { if (!contentActive) {
miMuteAll.soundEnabled = true miMuteAll.soundEnabled = true;
miStopAll.isPlaying = true miStopAll.isPlaying = true;
} }
} }
@ -206,12 +203,11 @@ Rectangle {
property bool soundEnabled: true property bool soundEnabled: true
onSoundEnabledChanged: { onSoundEnabledChanged: {
if (miMuteAll.soundEnabled) { if (miMuteAll.soundEnabled) {
miMuteAll.icon.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_volume.svg" miMuteAll.icon.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_volume.svg";
App.screenPlayManager.setAllWallpaperValue("muted", "false") App.screenPlayManager.setAllWallpaperValue("muted", "false");
} else { } else {
miMuteAll.icon.source miMuteAll.icon.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_volume_mute.svg";
= "qrc:/qml/ScreenPlayApp/assets/icons/icon_volume_mute.svg" App.screenPlayManager.setAllWallpaperValue("muted", "true");
App.screenPlayManager.setAllWallpaperValue("muted", "true")
} }
} }
@ -230,13 +226,11 @@ Rectangle {
property bool isPlaying: true property bool isPlaying: true
onIsPlayingChanged: { onIsPlayingChanged: {
if (miStopAll.isPlaying) { if (miStopAll.isPlaying) {
miStopAll.icon.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_pause.svg" miStopAll.icon.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_pause.svg";
App.screenPlayManager.setAllWallpaperValue("isPlaying", App.screenPlayManager.setAllWallpaperValue("isPlaying", "true");
"true")
} else { } else {
miStopAll.icon.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_play.svg" miStopAll.icon.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_play.svg";
App.screenPlayManager.setAllWallpaperValue("isPlaying", App.screenPlayManager.setAllWallpaperValue("isPlaying", "false");
"false")
} }
} }
hoverEnabled: true hoverEnabled: true
@ -252,10 +246,10 @@ Rectangle {
icon.width: root.iconWidth icon.width: root.iconWidth
icon.height: root.iconHeight icon.height: root.iconHeight
onClicked: { onClicked: {
App.screenPlayManager.removeAllWallpapers() App.screenPlayManager.removeAllWallpapers();
App.screenPlayManager.removeAllWidgets() App.screenPlayManager.removeAllWidgets();
miStopAll.isPlaying = true miStopAll.isPlaying = true;
miMuteAll.soundEnabled = true miMuteAll.soundEnabled = true;
} }
hoverEnabled: true hoverEnabled: true

View File

@ -19,11 +19,11 @@ Item {
width: parent.width width: parent.width
onAvailableChanged: { onAvailableChanged: {
if (!available) { if (!available) {
settingsBool.opacity = 0.5 settingsBool.opacity = 0.5;
radioButton.enabled = false radioButton.enabled = false;
} else { } else {
settingsButton.opacity = 1 settingsButton.opacity = 1;
radioButton.enabled = true radioButton.enabled = true;
} }
} }
@ -55,12 +55,10 @@ Item {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
linkColor: Material.color(Material.Orange) linkColor: Material.color(Material.Orange)
onLinkActivated: function (link) { onLinkActivated: function (link) {
Qt.openUrlExternally(link) Qt.openUrlExternally(link);
} }
color: Material.theme === Material.Light ? Qt.lighter( color: Material.theme === Material.Light ? Qt.lighter(Material.foreground) : Qt.darker(Material.foreground)
Material.foreground) : Qt.darker(
Material.foreground)
font.family: App.settings.font font.family: App.settings.font
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
@ -82,9 +80,9 @@ Item {
checked: settingsBool.isChecked checked: settingsBool.isChecked
onCheckedChanged: { onCheckedChanged: {
if (radioButton.checkState === Qt.Checked) if (radioButton.checkState === Qt.Checked)
checkboxChanged(true) checkboxChanged(true);
else else
checkboxChanged(false) checkboxChanged(false);
} }
anchors { anchors {

View File

@ -17,11 +17,11 @@ Item {
function indexOfValue(model, value) { function indexOfValue(model, value) {
for (var i = 0; i < model.length; i++) { for (var i = 0; i < model.length; i++) {
let ourValue = model[i].value let ourValue = model[i].value;
if (value === ourValue) if (value === ourValue)
return i return i;
} }
return -1 return -1;
} }
Flickable { Flickable {
@ -69,11 +69,12 @@ Item {
description: qsTr("ScreenPlay will start with Windows and will setup your Desktop every time for you.") description: qsTr("ScreenPlay will start with Windows and will setup your Desktop every time for you.")
isChecked: App.settings.autostart isChecked: App.settings.autostart
onCheckboxChanged: function (checked) { onCheckboxChanged: function (checked) {
App.settings.setAutostart(checked) App.settings.setAutostart(checked);
} }
} }
SettingsHorizontalSeperator {} SettingsHorizontalSeperator {
}
SettingBool { SettingBool {
headline: qsTr("High priority Autostart") headline: qsTr("High priority Autostart")
@ -81,11 +82,12 @@ Item {
description: qsTr("This options grants ScreenPlay a higher autostart priority than other apps.") description: qsTr("This options grants ScreenPlay a higher autostart priority than other apps.")
isChecked: App.settings.highPriorityStart isChecked: App.settings.highPriorityStart
onCheckboxChanged: { onCheckboxChanged: {
App.settings.setHighPriorityStart(checked) App.settings.setHighPriorityStart(checked);
} }
} }
SettingsHorizontalSeperator {} SettingsHorizontalSeperator {
}
SettingBool { SettingBool {
height: 70 height: 70
@ -93,33 +95,33 @@ Item {
description: qsTr("Help us make ScreenPlay faster and more stable. All collected data is purely anonymous and only used for development purposes! We use <a href=\"https://sentry.io\">sentry.io</a> to collect and analyze this data. A <b>big thanks to them</b> for providing us with free premium support for open source projects!") description: qsTr("Help us make ScreenPlay faster and more stable. All collected data is purely anonymous and only used for development purposes! We use <a href=\"https://sentry.io\">sentry.io</a> to collect and analyze this data. A <b>big thanks to them</b> for providing us with free premium support for open source projects!")
isChecked: App.settings.anonymousTelemetry isChecked: App.settings.anonymousTelemetry
onCheckboxChanged: function (checked) { onCheckboxChanged: function (checked) {
App.settings.setAnonymousTelemetry(checked) App.settings.setAnonymousTelemetry(checked);
} }
} }
SettingsHorizontalSeperator {} SettingsHorizontalSeperator {
}
SettingsButton { SettingsButton {
headline: qsTr("Set save location") headline: qsTr("Set save location")
buttonText: qsTr("Set location") buttonText: qsTr("Set location")
description: { description: {
// Remove file:/// so the used does not get confused // Remove file:/// so the used does not get confused
let path = App.globalVariables.localStoragePath + "" let path = App.globalVariables.localStoragePath + "";
if (path.length === 0) if (path.length === 0)
return qsTr("Your storage path is empty!") return qsTr("Your storage path is empty!");
else else
return path.replace('file:///', '') return path.replace('file:///', '');
} }
onButtonPressed: { onButtonPressed: {
folderDialogSaveLocation.open() folderDialogSaveLocation.open();
} }
FolderDialog { FolderDialog {
id: folderDialogSaveLocation id: folderDialogSaveLocation
folder: App.globalVariables.localStoragePath folder: App.globalVariables.localStoragePath
onAccepted: { onAccepted: {
App.settings.setLocalStoragePath( App.settings.setLocalStoragePath(folderDialogSaveLocation.currentFolder);
folderDialogSaveLocation.currentFolder)
} }
} }
} }
@ -142,7 +144,8 @@ Item {
} }
} }
SettingsHorizontalSeperator {} SettingsHorizontalSeperator {
}
SettingsComboBox { SettingsComboBox {
id: settingsLanguage id: settingsLanguage
@ -150,9 +153,7 @@ Item {
headline: qsTr("Language") headline: qsTr("Language")
description: qsTr("Set the ScreenPlay UI Language") description: qsTr("Set the ScreenPlay UI Language")
Component.onCompleted: { Component.onCompleted: {
settingsLanguage.comboBox.currentIndex = root.indexOfValue( settingsLanguage.comboBox.currentIndex = root.indexOfValue(settingsLanguage.comboBox.model, App.settings.language);
settingsLanguage.comboBox.model,
App.settings.language)
} }
comboBox { comboBox {
@ -197,14 +198,14 @@ Item {
"text": "Dutch" "text": "Dutch"
}] }]
onActivated: { onActivated: {
App.settings.setLanguage( App.settings.setLanguage(settingsLanguage.comboBox.currentValue);
settingsLanguage.comboBox.currentValue) App.settings.retranslateUI();
App.settings.retranslateUI()
} }
} }
} }
SettingsHorizontalSeperator {} SettingsHorizontalSeperator {
}
SettingsComboBox { SettingsComboBox {
id: settingsTheme id: settingsTheme
@ -212,9 +213,7 @@ Item {
headline: qsTr("Theme") headline: qsTr("Theme")
description: qsTr("Switch dark/light theme") description: qsTr("Switch dark/light theme")
Component.onCompleted: { Component.onCompleted: {
settingsTheme.comboBox.currentIndex = root.indexOfValue( settingsTheme.comboBox.currentIndex = root.indexOfValue(settingsTheme.comboBox.model, App.settings.theme);
settingsTheme.comboBox.model,
App.settings.theme)
} }
comboBox { comboBox {
@ -229,8 +228,7 @@ Item {
"text": qsTr("Light") "text": qsTr("Light")
}] }]
onActivated: { onActivated: {
App.settings.setTheme( App.settings.setTheme(settingsTheme.comboBox.currentValue);
settingsTheme.comboBox.currentValue)
} }
} }
} }
@ -256,11 +254,12 @@ Item {
description: qsTr("We disable the video rendering (not the audio!) for the best performance. If you have problem you can disable this behaviour here. Wallpaper restart required!") description: qsTr("We disable the video rendering (not the audio!) for the best performance. If you have problem you can disable this behaviour here. Wallpaper restart required!")
isChecked: App.settings.checkWallpaperVisible isChecked: App.settings.checkWallpaperVisible
onCheckboxChanged: function (checked) { onCheckboxChanged: function (checked) {
App.settings.setCheckWallpaperVisible(checked) App.settings.setCheckWallpaperVisible(checked);
} }
} }
SettingsHorizontalSeperator {} SettingsHorizontalSeperator {
}
SettingsComboBox { SettingsComboBox {
id: cbVideoFillMode id: cbVideoFillMode
@ -268,14 +267,11 @@ Item {
headline: qsTr("Default Fill Mode") headline: qsTr("Default Fill Mode")
description: qsTr("Set this property to define how the video is scaled to fit the target area.") description: qsTr("Set this property to define how the video is scaled to fit the target area.")
Component.onCompleted: { Component.onCompleted: {
cbVideoFillMode.comboBox.currentIndex = root.indexOfValue( cbVideoFillMode.comboBox.currentIndex = root.indexOfValue(cbVideoFillMode.comboBox.model, App.settings.videoFillMode);
cbVideoFillMode.comboBox.model,
App.settings.videoFillMode)
} }
comboBox { comboBox {
onActivated: App.settings.setVideoFillMode( onActivated: App.settings.setVideoFillMode(cbVideoFillMode.comboBox.currentValue)
cbVideoFillMode.comboBox.currentValue)
model: [{ model: [{
"value": FillMode.Stretch, "value": FillMode.Stretch,
"text": qsTr("Stretch") "text": qsTr("Stretch")
@ -319,8 +315,7 @@ Item {
Item { Item {
width: parent.width width: parent.width
height: txtHeadline.paintedHeight + txtDescriptionAbout.paintedHeight height: txtHeadline.paintedHeight + txtDescriptionAbout.paintedHeight + wrapperLinks.childrenRect.height + 80
+ wrapperLinks.childrenRect.height + 80
Text { Text {
id: txtHeadline id: txtHeadline
@ -443,26 +438,27 @@ Item {
} }
} }
SettingsHorizontalSeperator {} SettingsHorizontalSeperator {
}
SettingsButton { SettingsButton {
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_launch.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_launch.svg"
headline: qsTr("Version") headline: qsTr("Version")
description: App.settings.buildInfos description: App.settings.buildInfos
buttonText: qsTr("Open Changelog") buttonText: qsTr("Open Changelog")
onButtonPressed: Qt.openUrlExternally( onButtonPressed: Qt.openUrlExternally("https://gitlab.com/kelteseth/ScreenPlay/-/releases")
"https://gitlab.com/kelteseth/ScreenPlay/-/releases")
} }
SettingsHorizontalSeperator {} SettingsHorizontalSeperator {
}
SettingsButton { SettingsButton {
headline: qsTr("Third Party Software") headline: qsTr("Third Party Software")
description: qsTr("ScreenPlay would not be possible without the work of others. A big thank you to: ") description: qsTr("ScreenPlay would not be possible without the work of others. A big thank you to: ")
buttonText: qsTr("Licenses") buttonText: qsTr("Licenses")
onButtonPressed: { onButtonPressed: {
App.util.requestAllLicenses() App.util.requestAllLicenses();
expanderCopyright.toggle() expanderCopyright.toggle();
} }
} }
@ -471,21 +467,22 @@ Item {
Connections { Connections {
function onAllLicenseLoaded(licensesText) { function onAllLicenseLoaded(licensesText) {
expanderCopyright.text = licensesText expanderCopyright.text = licensesText;
} }
target: App.util target: App.util
} }
} }
SettingsHorizontalSeperator {} SettingsHorizontalSeperator {
}
SettingsButton { SettingsButton {
headline: qsTr("Logs") headline: qsTr("Logs")
description: qsTr("If your ScreenPlay missbehaves this is a good way to look for answers. This shows all logs and warning during runtime.") description: qsTr("If your ScreenPlay missbehaves this is a good way to look for answers. This shows all logs and warning during runtime.")
buttonText: qsTr("Show Logs") buttonText: qsTr("Show Logs")
onButtonPressed: { onButtonPressed: {
expanderDebug.toggle() expanderDebug.toggle();
} }
} }
@ -495,15 +492,16 @@ Item {
text: App.util.debugMessages text: App.util.debugMessages
} }
SettingsHorizontalSeperator {} SettingsHorizontalSeperator {
}
SettingsButton { SettingsButton {
headline: qsTr("Data Protection") headline: qsTr("Data Protection")
description: qsTr("We use you data very carefully to improve ScreenPlay. We do not sell or share this (anonymous) information with others!") description: qsTr("We use you data very carefully to improve ScreenPlay. We do not sell or share this (anonymous) information with others!")
buttonText: qsTr("Privacy") buttonText: qsTr("Privacy")
onButtonPressed: { onButtonPressed: {
App.util.requestDataProtection() App.util.requestDataProtection();
expanderDataProtection.toggle() expanderDataProtection.toggle();
} }
} }
@ -512,7 +510,7 @@ Item {
Connections { Connections {
function onAllDataProtectionLoaded(dataProtectionText) { function onAllDataProtectionLoaded(dataProtectionText) {
expanderDataProtection.text = dataProtectionText expanderDataProtection.text = dataProtectionText;
} }
target: App.util target: App.util

View File

@ -16,7 +16,7 @@ Item {
property bool enabled: true property bool enabled: true
property bool available: true property bool available: true
signal buttonPressed() signal buttonPressed
height: txtHeadline.paintedHeight + txtDescription.paintedHeight + 20 height: txtHeadline.paintedHeight + txtDescription.paintedHeight + 20
width: parent.width width: parent.width
@ -46,7 +46,6 @@ Item {
left: parent.left left: parent.left
leftMargin: 20 leftMargin: 20
} }
} }
Text { Text {
@ -68,7 +67,6 @@ Item {
right: btnSettings.left right: btnSettings.left
rightMargin: 20 rightMargin: 20
} }
} }
Button { Button {
@ -87,7 +85,5 @@ Item {
rightMargin: 20 rightMargin: 20
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
} }

View File

@ -32,7 +32,6 @@ Control {
left: parent.left left: parent.left
leftMargin: 20 leftMargin: 20
} }
} }
Text { Text {
@ -54,7 +53,6 @@ Control {
right: comboBox.left right: comboBox.left
rightMargin: 20 rightMargin: 20
} }
} }
ComboBox { ComboBox {
@ -70,7 +68,5 @@ Control {
rightMargin: 20 rightMargin: 20
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
} }

View File

@ -41,7 +41,6 @@ Item {
left: parent.left left: parent.left
margins: 20 margins: 20
} }
} }
MouseArea { MouseArea {
@ -55,7 +54,6 @@ Item {
snapMode: ScrollBar.SnapOnRelease snapMode: ScrollBar.SnapOnRelease
policy: ScrollBar.AlwaysOn policy: ScrollBar.AlwaysOn
} }
} }
Menu { Menu {
@ -67,7 +65,6 @@ Item {
App.util.copyToClipboard(txtExpander.text); App.util.copyToClipboard(txtExpander.text);
} }
} }
} }
states: [ states: [
@ -78,7 +75,6 @@ Item {
target: root target: root
height: 500 height: 500
} }
}, },
State { State {
name: "off" name: "off"
@ -87,7 +83,6 @@ Item {
target: root target: root
height: 0 height: 0
} }
} }
] ]
transitions: [ transitions: [
@ -101,7 +96,6 @@ Item {
property: "height" property: "height"
duration: 250 duration: 250
} }
} }
] ]
} }

View File

@ -28,7 +28,6 @@ Item {
right: parent.right right: parent.right
left: parent.left left: parent.left
} }
} }
Rectangle { Rectangle {
@ -63,7 +62,6 @@ Item {
left: parent.left left: parent.left
leftMargin: 0 leftMargin: 0
} }
} }
ColorOverlay { ColorOverlay {
@ -89,11 +87,8 @@ Item {
left: parent.left left: parent.left
leftMargin: 30 leftMargin: 30
} }
} }
} }
} }
states: [ states: [
@ -111,7 +106,6 @@ Item {
anchors.topMargin: 10 anchors.topMargin: 10
opacity: 0 opacity: 0
} }
}, },
State { State {
name: "in" name: "in"
@ -127,7 +121,6 @@ Item {
anchors.topMargin: 2 anchors.topMargin: 2
opacity: 1 opacity: 1
} }
} }
] ]
transitions: [ transitions: [
@ -142,7 +135,6 @@ Item {
duration: 400 duration: 400
easing.type: Easing.InOutQuart easing.type: Easing.InOutQuart
} }
} }
] ]
} }

View File

@ -23,7 +23,5 @@ Item {
leftMargin: customMargin leftMargin: customMargin
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
} }

View File

@ -14,12 +14,11 @@ Item {
Component.onCompleted: { Component.onCompleted: {
if (App.settings.steamVersion) { if (App.settings.steamVersion) {
workshopLoader.setSource( workshopLoader.setSource("qrc:/qml/ScreenPlayWorkshop/qml/SteamWorkshop.qml", {
"qrc:/qml/ScreenPlayWorkshop/qml/SteamWorkshop.qml", { "modalSource": modalSource
"modalSource": modalSource });
})
} else { } else {
workshopLoader.setSource("qrc:/qml/ScreenPlayWorkshop/qml/Forum.qml") workshopLoader.setSource("qrc:/qml/ScreenPlayWorkshop/qml/Forum.qml");
} }
} }

View File

@ -5,19 +5,19 @@
#include "ScreenPlayUtil/macutils.h" #include "ScreenPlayUtil/macutils.h"
#endif #endif
#include "app.h"
#include "steam/steam_qt_enums_generated.h" #include "steam/steam_qt_enums_generated.h"
#include <QProcessEnvironment> #include <QProcessEnvironment>
#include <QQuickStyle> #include <QQuickStyle>
#include <QVersionNumber> #include <QVersionNumber>
#include "app.h"
namespace ScreenPlay { namespace ScreenPlay {
/*! /*!
\module ScreenPlay \module ScreenPlay
\title ScreenPlay \title ScreenPlay
\brief Module for ScreenPlay. \brief Module for ScreenPlay.
*/ */
/*! /*!
@ -367,138 +367,138 @@ void App::setGlobalVariables(GlobalVariables* globalVariables)
\property App::screenPlayManager \property App::screenPlayManager
\brief Sets the screen play manager. \brief Sets the screen play manager.
*/ */
void App::setScreenPlayManager(ScreenPlayManager* screenPlayManager) void App::setScreenPlayManager(ScreenPlayManager* screenPlayManager)
{ {
if (m_screenPlayManager.get() == screenPlayManager) if (m_screenPlayManager.get() == screenPlayManager)
return; return;
m_screenPlayManager.reset(screenPlayManager); m_screenPlayManager.reset(screenPlayManager);
emit screenPlayManagerChanged(m_screenPlayManager.get()); emit screenPlayManagerChanged(m_screenPlayManager.get());
} }
/*! /*!
\property App::create \property App::create
\brief . \brief .
. .
*/ */
void App::setCreate(Create* create) void App::setCreate(Create* create)
{ {
if (m_create.get() == create) if (m_create.get() == create)
return; return;
m_create.reset(create); m_create.reset(create);
emit createChanged(m_create.get()); emit createChanged(m_create.get());
} }
/*! /*!
\property App::util \property App::util
\brief . \brief .
. .
*/ */
void App::setUtil(Util* util) void App::setUtil(Util* util)
{ {
if (m_util.get() == util) if (m_util.get() == util)
return; return;
m_util.reset(util); m_util.reset(util);
emit utilChanged(m_util.get()); emit utilChanged(m_util.get());
} }
/*! /*!
\property App::settings \property App::settings
\brief . \brief .
. .
*/ */
void App::setSettings(Settings* settings) void App::setSettings(Settings* settings)
{ {
if (m_settings.get() == settings) if (m_settings.get() == settings)
return; return;
m_settings.reset(settings); m_settings.reset(settings);
emit settingsChanged(m_settings.get()); emit settingsChanged(m_settings.get());
} }
/*! /*!
\property App::installedListModel \property App::installedListModel
\brief . \brief .
. .
*/ */
void App::setInstalledListModel(InstalledListModel* installedListModel) void App::setInstalledListModel(InstalledListModel* installedListModel)
{ {
if (m_installedListModel.get() == installedListModel) if (m_installedListModel.get() == installedListModel)
return; return;
m_installedListModel.reset(installedListModel); m_installedListModel.reset(installedListModel);
emit installedListModelChanged(m_installedListModel.get()); emit installedListModelChanged(m_installedListModel.get());
} }
/*! /*!
\property App::monitorListModel \property App::monitorListModel
\brief . \brief .
. .
*/ */
void App::setMonitorListModel(MonitorListModel* monitorListModel) void App::setMonitorListModel(MonitorListModel* monitorListModel)
{ {
if (m_monitorListModel.get() == monitorListModel) if (m_monitorListModel.get() == monitorListModel)
return; return;
m_monitorListModel.reset(monitorListModel); m_monitorListModel.reset(monitorListModel);
emit monitorListModelChanged(m_monitorListModel.get()); emit monitorListModelChanged(m_monitorListModel.get());
} }
/*! /*!
\property App::profileListModel \property App::profileListModel
\brief . \brief .
. .
*/ */
void App::setProfileListModel(ProfileListModel* profileListModel) void App::setProfileListModel(ProfileListModel* profileListModel)
{ {
if (m_profileListModel.get() == profileListModel) if (m_profileListModel.get() == profileListModel)
return; return;
m_profileListModel.reset(profileListModel); m_profileListModel.reset(profileListModel);
emit profileListModelChanged(m_profileListModel.get()); emit profileListModelChanged(m_profileListModel.get());
} }
/*! /*!
\property App::installedListFilter \property App::installedListFilter
\brief . \brief .
. .
*/ */
void App::setInstalledListFilter(InstalledListFilter* installedListFilter) void App::setInstalledListFilter(InstalledListFilter* installedListFilter)
{ {
if (m_installedListFilter.get() == installedListFilter) if (m_installedListFilter.get() == installedListFilter)
return; return;
m_installedListFilter.reset(installedListFilter); m_installedListFilter.reset(installedListFilter);
emit installedListFilterChanged(m_installedListFilter.get()); emit installedListFilterChanged(m_installedListFilter.get());
} }
/*! /*!
\property App::mainWindowEngine \property App::mainWindowEngine
\brief . \brief .
. .
*/ */
void App::setMainWindowEngine(QQmlApplicationEngine* mainWindowEngine) void App::setMainWindowEngine(QQmlApplicationEngine* mainWindowEngine)
{ {
if (m_mainWindowEngine.get() == mainWindowEngine) if (m_mainWindowEngine.get() == mainWindowEngine)
return; return;
m_mainWindowEngine.reset(mainWindowEngine); m_mainWindowEngine.reset(mainWindowEngine);
emit mainWindowEngineChanged(m_mainWindowEngine.get()); emit mainWindowEngineChanged(m_mainWindowEngine.get());
} }
/*! /*!
\property App::wizards \property App::wizards
\brief . \brief .
. .
*/ */
void App::setWizards(Wizards* wizards) void App::setWizards(Wizards* wizards)
{ {
if (m_wizards.get() == wizards) if (m_wizards.get() == wizards)
return; return;
m_wizards.reset(wizards); m_wizards.reset(wizards);
emit wizardsChanged(m_wizards.get()); emit wizardsChanged(m_wizards.get());
} }
} }

View File

@ -152,5 +152,4 @@ qt_TexCoord0 = qt_MultiTexCoord0;
root.iDate.w = currentDate.getSeconds(); root.iDate.w = currentDate.getSeconds();
} }
} }
} }

View File

@ -22,8 +22,7 @@ Window {
property real frequency: 2 property real frequency: 2
property real time: 0 property real time: 0
property real framerate: 60 property real framerate: 60
property real updateInterval: Math.round( property real updateInterval: Math.round((1000 / framerate) * 10) / 10
(1000 / framerate) * 10) / 10
Timer { Timer {
interval: updateInterval interval: updateInterval
@ -32,9 +31,9 @@ Window {
repeat: true repeat: true
onTriggered: { onTriggered: {
if (parent.time > 600) { if (parent.time > 600) {
parent.time = 0 parent.time = 0;
} }
parent.time += 1 parent.time += 1;
} }
} }

View File

@ -25,11 +25,11 @@ Window {
} }
function stringListToString(list) { function stringListToString(list) {
let out = "" let out = "";
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
out += "\n" + list[i] out += "\n" + list[i];
} }
return out return out;
} }
Rectangle { Rectangle {
@ -45,14 +45,13 @@ Window {
} }
RowLayout { RowLayout {
id:wrapper id: wrapper
spacing: 40 spacing: 40
anchors.centerIn: parent anchors.centerIn: parent
ColumnLayout { ColumnLayout {
id: wrapperLeft id: wrapperLeft
Layout.preferredWidth: 500 Layout.preferredWidth: 500
ColumnLayout { ColumnLayout {
spacing: 10 spacing: 10
Item { Item {
@ -67,8 +66,7 @@ Window {
} }
} }
Text { Text {
text: root.stringListToString( text: root.stringListToString(ipAddress.privateIpV4AddressList)
ipAddress.privateIpV4AddressList)
color: root.accentColor color: root.accentColor
font { font {
pointSize: 16 pointSize: 16
@ -76,8 +74,7 @@ Window {
} }
} }
Text { Text {
text: root.stringListToString( text: root.stringListToString(ipAddress.privateIpV6AddressList)
ipAddress.privateIpV6AddressList)
color: root.accentColor color: root.accentColor
font { font {
pointSize: 16 pointSize: 16
@ -236,7 +233,6 @@ Window {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
} }
ListView { ListView {
id: storageListView id: storageListView
Layout.fillWidth: true Layout.fillWidth: true

View File

@ -40,15 +40,19 @@ set(QML
qml/TextField.qml qml/TextField.qml
qml/TrayIcon.qml) qml/TrayIcon.qml)
set(SOURCES # cmake-format: sort set(SOURCES
inc/public/ScreenPlayUtil/httpfileserver.cpp src/contenttypes.cpp src/util.cpp src/projectfile.cpp) # cmake-format: sort
inc/public/ScreenPlayUtil/httpfileserver.cpp
src/contenttypes.cpp
src/projectfile.cpp
src/util.cpp)
set(HEADER set(HEADER
# cmake-format: sort # cmake-format: sort
inc/public/ScreenPlayUtil/exitcodes.h
inc/public/ScreenPlayUtil/AutoPropertyHelpers.h inc/public/ScreenPlayUtil/AutoPropertyHelpers.h
inc/public/ScreenPlayUtil/ConstRefPropertyHelpers.h inc/public/ScreenPlayUtil/ConstRefPropertyHelpers.h
inc/public/ScreenPlayUtil/contenttypes.h inc/public/ScreenPlayUtil/contenttypes.h
inc/public/ScreenPlayUtil/exitcodes.h
inc/public/ScreenPlayUtil/HelpersCommon.h inc/public/ScreenPlayUtil/HelpersCommon.h
inc/public/ScreenPlayUtil/httpfileserver.h inc/public/ScreenPlayUtil/httpfileserver.h
inc/public/ScreenPlayUtil/ListPropertyHelper.h inc/public/ScreenPlayUtil/ListPropertyHelper.h

View File

@ -35,7 +35,6 @@ Rectangle {
target: bgWorkshop target: bgWorkshop
opacity: 0 opacity: 0
} }
}, },
State { State {
name: "create" name: "create"
@ -49,7 +48,6 @@ Rectangle {
target: bgWorkshop target: bgWorkshop
opacity: 0 opacity: 0
} }
}, },
State { State {
name: "community" name: "community"
@ -63,7 +61,6 @@ Rectangle {
target: bgWorkshop target: bgWorkshop
opacity: 0 opacity: 0
} }
}, },
State { State {
name: "workshop" name: "workshop"
@ -77,7 +74,6 @@ Rectangle {
target: bgWorkshop target: bgWorkshop
opacity: 1 opacity: 1
} }
} }
] ]
transitions: [ transitions: [
@ -91,7 +87,6 @@ Rectangle {
duration: 400 duration: 400
easing.type: Easing.InOutQuart easing.type: Easing.InOutQuart
} }
} }
] ]
} }

View File

@ -64,7 +64,6 @@ MouseArea {
target: iconColorOverlay target: iconColorOverlay
color: Material.color(Material.Orange) color: Material.color(Material.Orange)
} }
} }
] ]
transitions: [ transitions: [
@ -78,7 +77,6 @@ MouseArea {
duration: 200 duration: 200
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }
} }
] ]
} }

View File

@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls.Material import QtQuick.Controls.Material
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
/*! /*!
\qmltype ColorImage \qmltype ColorImage
\inqmlmodule Common \inqmlmodule Common
@ -14,7 +13,6 @@ import Qt5Compat.GraphicalEffects
Image { Image {
id: root id: root
/*! /*!
\qmlproperty color ColorImage::color \qmlproperty color ColorImage::color

View File

@ -23,7 +23,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Controls import QtQuick.Controls
@ -65,9 +64,9 @@ Pane {
function hexToRgb(hex) { function hexToRgb(hex) {
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(shorthandRegex, function(m, r, g, b) { hex = hex.replace(shorthandRegex, function (m, r, g, b) {
return r + r + g + g + b + b; return r + r + g + g + b + b;
}); });
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? { return result ? {
"r": parseInt(result[1], 16), "r": parseInt(result[1], 16),
@ -188,9 +187,7 @@ Pane {
position: 1 position: 1
color: hueColor color: hueColor
} }
} }
} }
Rectangle { Rectangle {
@ -211,9 +208,7 @@ Pane {
position: 0 position: 0
color: "#00000000" color: "#00000000"
} }
} }
} }
Rectangle { Rectangle {
@ -234,7 +229,6 @@ Pane {
radius: width / 2 radius: width / 2
color: "transparent" color: "transparent"
} }
} }
MouseArea { MouseArea {
@ -250,7 +244,6 @@ Pane {
onPositionChanged: handleMouse(mouse) onPositionChanged: handleMouse(mouse)
onPressed: handleMouse(mouse) onPressed: handleMouse(mouse)
} }
} }
Rectangle { Rectangle {
@ -272,7 +265,6 @@ Pane {
PathSvg { PathSvg {
path: "M0,0 L30,0" path: "M0,0 L30,0"
} }
} }
ShapePath { ShapePath {
@ -283,9 +275,7 @@ Pane {
PathSvg { PathSvg {
path: "M0,-5 L30,-5 L30,4 L0,4z" path: "M0,-5 L30,-5 L30,4 L0,4z"
} }
} }
} }
MouseArea { MouseArea {
@ -329,11 +319,8 @@ Pane {
position: 0 position: 0
color: "#FF0000" color: "#FF0000"
} }
} }
} }
} }
ColumnLayout { ColumnLayout {
@ -356,7 +343,6 @@ Pane {
onValueChanged: { onValueChanged: {
if (!updatingControls) if (!updatingControls)
setCurrentColor(); setCurrentColor();
} }
} }
@ -375,7 +361,6 @@ Pane {
onValueChanged: { onValueChanged: {
if (!updatingControls) if (!updatingControls)
setCurrentColor(); setCurrentColor();
} }
} }
@ -394,14 +379,12 @@ Pane {
onValueChanged: { onValueChanged: {
if (!updatingControls) if (!updatingControls)
setCurrentColor(); setCurrentColor();
} }
} }
Item { Item {
Layout.fillHeight: true Layout.fillHeight: true
} }
} }
Rectangle { Rectangle {
@ -436,22 +419,16 @@ Pane {
var compColor = Qt.rgba(1, 1, 1, 1); var compColor = Qt.rgba(1, 1, 1, 1);
if (color.hsvValue > 0.5) if (color.hsvValue > 0.5)
compColor = Qt.rgba(0, 0, 0, 1); compColor = Qt.rgba(0, 0, 0, 1);
border.color = compColor; border.color = compColor;
} }
onExited: { onExited: {
border.width = 0; border.width = 0;
} }
} }
} }
} }
} }
} }
} }
Canvas { Canvas {
@ -480,7 +457,6 @@ Pane {
PathSvg { PathSvg {
path: "M0,0 L30,0" path: "M0,0 L30,0"
} }
} }
ShapePath { ShapePath {
@ -491,9 +467,7 @@ Pane {
PathSvg { PathSvg {
path: "M0,-5 L30,-5 L30,4 L0,4z" path: "M0,-5 L30,-5 L30,4 L0,4z"
} }
} }
} }
MouseArea { MouseArea {
@ -513,11 +487,8 @@ Pane {
position: 1 position: 1
color: "#00000000" color: "#00000000"
} }
} }
} }
} }
ColumnLayout { ColumnLayout {
@ -555,11 +526,8 @@ Pane {
Layout.fillHeight: true Layout.fillHeight: true
color: currentColor color: currentColor
} }
} }
} }
} }
ColumnLayout { ColumnLayout {
@ -580,7 +548,6 @@ Pane {
leftPadding: optRgb.indicator.width + optRgb.spacing leftPadding: optRgb.indicator.width + optRgb.spacing
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
} }
RadioButton { RadioButton {
@ -600,9 +567,7 @@ Pane {
leftPadding: optHsv.indicator.width + optHsv.spacing leftPadding: optHsv.indicator.width + optHsv.spacing
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
} }
} }
Item { Item {
@ -623,7 +588,6 @@ Pane {
Layout.fillWidth: true Layout.fillWidth: true
color: BppMetrics.textColor color: BppMetrics.textColor
} }
} }
RowLayout { RowLayout {
@ -640,7 +604,6 @@ Pane {
Layout.fillWidth: true Layout.fillWidth: true
color: BppMetrics.textColor color: BppMetrics.textColor
} }
} }
RowLayout { RowLayout {
@ -657,7 +620,6 @@ Pane {
Layout.fillWidth: true Layout.fillWidth: true
color: BppMetrics.textColor color: BppMetrics.textColor
} }
} }
RowLayout { RowLayout {
@ -674,7 +636,6 @@ Pane {
Layout.fillWidth: true Layout.fillWidth: true
color: BppMetrics.textColor color: BppMetrics.textColor
} }
} }
RowLayout { RowLayout {
@ -691,7 +652,6 @@ Pane {
Layout.fillWidth: true Layout.fillWidth: true
color: BppMetrics.textColor color: BppMetrics.textColor
} }
} }
RowLayout { RowLayout {
@ -708,7 +668,6 @@ Pane {
Layout.fillWidth: true Layout.fillWidth: true
color: BppMetrics.textColor color: BppMetrics.textColor
} }
} }
Item { Item {
@ -729,7 +688,6 @@ Pane {
Layout.fillWidth: true Layout.fillWidth: true
color: BppMetrics.textColor color: BppMetrics.textColor
} }
} }
RowLayout { RowLayout {
@ -751,23 +709,16 @@ Pane {
color: BppMetrics.textColor color: BppMetrics.textColor
onTextChanged: { onTextChanged: {
if (!hexColor.focus) if (!hexColor.focus)
return ; return;
if (!updatingControls && acceptableInput) { if (!updatingControls && acceptableInput) {
//console.log('updating', rgbColor.r, currentColor.r * 255, rgbColor.g, currentColor.g * 255, rgbColor.b, currentColor.b * 255) //console.log('updating', rgbColor.r, currentColor.r * 255, rgbColor.g, currentColor.g * 255, rgbColor.b, currentColor.b * 255)
var rgbColor = hexToRgb(text); var rgbColor = hexToRgb(text);
if (rgbColor && rgbColor.r !== Math.floor(currentColor.r * 255) && rgbColor.g !== Math.floor(currentColor.g * 255) && rgbColor.b !== Math.floor(currentColor.b * 255)) if (rgbColor && rgbColor.r !== Math.floor(currentColor.r * 255) && rgbColor.g !== Math.floor(currentColor.g * 255) && rgbColor.b !== Math.floor(currentColor.b * 255))
initColorRGB(rgbColor.r, rgbColor.g, rgbColor.b, currentColor.a * 255); initColorRGB(rgbColor.r, rgbColor.g, rgbColor.b, currentColor.a * 255);
} }
} }
} }
} }
} }
} }
} }

View File

@ -15,15 +15,14 @@ Util.Dialog {
property string message property string message
standardButtons: Dialog.Ok | Dialog.Help standardButtons: Dialog.Ok | Dialog.Help
onHelpRequested: { onHelpRequested: {
Qt.openUrlExternally( Qt.openUrlExternally("https://forum.screen-play.app/category/7/troubleshooting");
"https://forum.screen-play.app/category/7/troubleshooting")
} }
Connections { Connections {
function onDisplayErrorPopup(msg) { function onDisplayErrorPopup(msg) {
root.message = msg root.message = msg;
root.window.show() root.window.show();
root.open() root.open();
} }
target: App.screenPlayManager target: App.screenPlayManager

View File

@ -14,7 +14,7 @@ Util.Dialog {
Connections { Connections {
function onMonitorConfigurationChanged() { function onMonitorConfigurationChanged() {
root.open() root.open();
} }
target: App.monitorListModel target: App.monitorListModel

View File

@ -73,7 +73,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 10 margins: 10
} }
} }
Text { Text {
@ -94,7 +93,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 10 margins: 10
} }
} }
Button { Button {
@ -114,7 +112,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 5 margins: 5
} }
} }
Button { Button {
@ -133,7 +130,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 5 margins: 5
} }
} }
FileDialog { FileDialog {
@ -141,11 +137,10 @@ Item {
title: qsTr("Please choose a file") title: qsTr("Please choose a file")
onAccepted: { onAccepted: {
root.file = fileDialog.currentFile ; root.file = fileDialog.currentFile;
txtName.text = fileDialog.currentFile.toString(); txtName.text = fileDialog.currentFile.toString();
} }
} }
} }
states: [ states: [
@ -162,7 +157,6 @@ Item {
target: txtPlaceholder target: txtPlaceholder
opacity: 0 opacity: 0
} }
}, },
State { State {
name: "nothingSelected" name: "nothingSelected"
@ -172,7 +166,6 @@ Item {
opacity: 0 opacity: 0
anchors.topMargin: -40 anchors.topMargin: -40
} }
} }
] ]
transitions: [ transitions: [
@ -194,7 +187,6 @@ Item {
duration: 300 duration: 300
easing.type: Easing.OutQuart easing.type: Easing.OutQuart
} }
} }
] ]
} }

View File

@ -43,13 +43,10 @@ Scale {
to: 1 to: 1
duration: 300 duration: 300
} }
} }
PauseAnimation { PauseAnimation {
duration: root.loopOffset duration: root.loopOffset
} }
} }
} }

View File

@ -51,7 +51,6 @@ Rectangle {
height: 34 height: 34
sourceSize: Qt.size(34, 34) sourceSize: Qt.size(34, 34)
} }
} }
] ]
transitions: [ transitions: [
@ -66,7 +65,6 @@ Rectangle {
duration: 200 duration: 200
easing.type: Easing.InOutQuart easing.type: Easing.InOutQuart
} }
} }
] ]
} }

View File

@ -29,7 +29,5 @@ Item {
left: parent.left left: parent.left
bottom: parent.bottom bottom: parent.bottom
} }
} }
} }

View File

@ -83,10 +83,8 @@ Item {
onClicked: { onClicked: {
if (imageSource !== "") if (imageSource !== "")
popup.open(); popup.open();
} }
} }
} }
Popup { Popup {
@ -107,7 +105,6 @@ Item {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: popup.close() onClicked: popup.close()
} }
} }
Text { Text {
@ -130,7 +127,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 10 margins: 10
} }
} }
Text { Text {
@ -151,7 +147,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 10 margins: 10
} }
} }
Button { Button {
@ -168,7 +163,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 5 margins: 5
} }
} }
Button { Button {
@ -187,7 +181,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
margins: 5 margins: 5
} }
} }
FileDialog { FileDialog {
@ -200,7 +193,6 @@ Item {
txtName.text = fileDialog.fileUrl.toString().replace(/^.*[\\\/]/, ''); txtName.text = fileDialog.fileUrl.toString().replace(/^.*[\\\/]/, '');
} }
} }
} }
states: [ states: [
@ -217,7 +209,6 @@ Item {
target: txtPlaceholder target: txtPlaceholder
opacity: 0 opacity: 0
} }
}, },
State { State {
name: "nothingSelected" name: "nothingSelected"
@ -227,7 +218,6 @@ Item {
opacity: 0 opacity: 0
anchors.topMargin: -40 anchors.topMargin: -40
} }
} }
] ]
transitions: [ transitions: [
@ -249,7 +239,6 @@ Item {
duration: 300 duration: 300
easing.type: Easing.OutQuart easing.type: Easing.OutQuart
} }
} }
] ]
} }

View File

@ -79,9 +79,7 @@ ColumnLayout {
description: qsTr("You do not share any rights and nobody is allowed to use or remix it (Not recommended). Can also used to credit work others.") description: qsTr("You do not share any rights and nobody is allowed to use or remix it (Not recommended). Can also used to credit work others.")
licenseFile: "License_All_Rights_Reserved_1.0.txt" licenseFile: "License_All_Rights_Reserved_1.0.txt"
} }
} }
} }
ToolButton { ToolButton {
@ -101,7 +99,5 @@ ColumnLayout {
text: licenseModel.get(cb.currentIndex).description text: licenseModel.get(cb.currentIndex).description
} }
} }
} }

View File

@ -3,7 +3,6 @@
* https://github.com/rschiang/material * https://github.com/rschiang/material
* (THE BSD 2-CLAUSE LICENSE) * (THE BSD 2-CLAUSE LICENSE)
*/ */
import QtQuick import QtQuick
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material import QtQuick.Controls.Material
@ -18,10 +17,10 @@ Item {
function trigger() { function trigger() {
var wave = ripple.createObject(container, { var wave = ripple.createObject(container, {
"startX": root.width * 0.5, "startX": root.width * 0.5,
"startY": root.height * 0.5, "startY": root.height * 0.5,
"maxRadius": furthestDistance(root.width * 0.5, root.height * 0.5) "maxRadius": furthestDistance(root.width * 0.5, root.height * 0.5)
}); });
} }
function distance(x1, y1, x2, y2) { function distance(x1, y1, x2, y2) {
@ -68,7 +67,6 @@ Item {
function fadeIfApplicable() { function fadeIfApplicable() {
if (!fadeAnimation.running) if (!fadeAnimation.running)
fadeAnimation.start(); fadeAnimation.start();
} }
radius: 0 radius: 0
@ -82,7 +80,6 @@ Item {
growAnimation.start(); growAnimation.start();
if (!fadeAnimation.running) if (!fadeAnimation.running)
fadeAnimation.start(); fadeAnimation.start();
} }
NumberAnimation { NumberAnimation {
@ -110,11 +107,7 @@ Item {
ScriptAction { ScriptAction {
script: ink.destroy() script: ink.destroy()
} }
} }
} }
} }
} }

View File

@ -23,7 +23,6 @@ Item {
right: parent.right right: parent.right
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
} }
TextField { TextField {
@ -46,7 +45,5 @@ Item {
top: parent.top top: parent.top
topMargin: 10 topMargin: 10
} }
} }
} }

View File

@ -75,13 +75,10 @@ Translate {
to: 0 to: 0
duration: 50 duration: 50
} }
} }
PauseAnimation { PauseAnimation {
duration: root.loopOffset duration: root.loopOffset
} }
} }
} }

View File

@ -51,7 +51,6 @@ Item {
font.pointSize: 14 font.pointSize: 14
font.family: App.settings.font font.family: App.settings.font
} }
} }
MouseArea { MouseArea {
@ -76,7 +75,6 @@ Item {
anchors.fill: parent anchors.fill: parent
source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_close.svg" source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_close.svg"
} }
} }
states: [ states: [
@ -93,7 +91,6 @@ Item {
opacity: 1 opacity: 1
enabled: true enabled: true
} }
} }
] ]
} }

View File

@ -9,29 +9,28 @@ Item {
id: root id: root
function getTags() { function getTags() {
var array = [] var array = [];
for (var i = 0; i < listModel.count; i++) { for (var i = 0; i < listModel.count; i++) {
array.push(listModel.get(i)._name) array.push(listModel.get(i)._name);
} }
return array return array;
} }
height: 70 height: 70
implicitWidth: 200 implicitWidth: 200
onStateChanged: { onStateChanged: {
if (root.state === "add") { if (root.state === "add") {
btnAdd.text = qsTr("Save") btnAdd.text = qsTr("Save");
textField.focus = true textField.focus = true;
} else { } else {
btnAdd.text = qsTr("Add tag") btnAdd.text = qsTr("Add tag");
} }
} }
Rectangle { Rectangle {
id: rectangle id: rectangle
color: Material.theme === Material.Light ? Material.background : Qt.darker( color: Material.theme === Material.Light ? Material.background : Qt.darker(Material.background)
Material.background)
radius: 3 radius: 3
clip: true clip: true
@ -61,7 +60,7 @@ Item {
Connections { Connections {
function onRemoveThis() { function onRemoveThis() {
listModel.remove(itemIndex) listModel.remove(itemIndex);
} }
target: delegate target: delegate
@ -83,9 +82,7 @@ Item {
radius: 3 radius: 3
height: parent.height - 20 height: parent.height - 20
width: 200 width: 200
color: Material.theme color: Material.theme === Material.Light ? Qt.lighter(Material.background) : Material.background
=== Material.Light ? Qt.lighter(
Material.background) : Material.background
anchors { anchors {
top: parent.top top: parent.top
@ -113,7 +110,7 @@ Item {
color: Material.primaryTextColor color: Material.primaryTextColor
onTextChanged: { onTextChanged: {
if (textField.length >= 10) if (textField.length >= 10)
textField.text = textField.text textField.text = textField.text;
} }
anchors { anchors {
@ -135,8 +132,8 @@ Item {
highlighted: true highlighted: true
font.family: App.settings.font font.family: App.settings.font
onClicked: { onClicked: {
root.state = "" root.state = "";
textField.clear() textField.clear();
} }
anchors { anchors {
@ -157,12 +154,12 @@ Item {
onClicked: { onClicked: {
if (root.state === "add") { if (root.state === "add") {
listModel.append({ listModel.append({
"_name": textField.text "_name": textField.text
}) });
textField.clear() textField.clear();
root.state = "" root.state = "";
} else { } else {
root.state = "add" root.state = "add";
} }
} }

View File

@ -15,7 +15,7 @@ Item {
property alias text: textField.text property alias text: textField.text
property alias placeholderText: txtPlaceholder.text property alias placeholderText: txtPlaceholder.text
signal editingFinished() signal editingFinished
height: 55 height: 55
width: 150 width: 150
@ -27,8 +27,7 @@ Item {
} }
onEditingFinished: { onEditingFinished: {
if (!root.required) if (!root.required)
return ; return;
} }
Text { Text {
@ -47,7 +46,6 @@ Item {
left: parent.left left: parent.left
leftMargin: 10 leftMargin: 10
} }
} }
Timer { Timer {
@ -63,7 +61,6 @@ Item {
function resetState() { function resetState() {
if (textField.text.length === 0) if (textField.text.length === 0)
root.state = ""; root.state = "";
textField.focus = false; textField.focus = false;
} }
@ -80,7 +77,6 @@ Item {
resetState(); resetState();
if (textField.text.length > 0) if (textField.text.length > 0)
root.state = "containsTextEditingFinished"; root.state = "containsTextEditingFinished";
} }
onPressed: { onPressed: {
root.state = "containsText"; root.state = "containsText";
@ -91,7 +87,6 @@ Item {
right: parent.right right: parent.right
bottom: parent.bottom bottom: parent.bottom
} }
} }
Text { Text {
@ -106,7 +101,6 @@ Item {
top: textField.bottom top: textField.bottom
right: textField.right right: textField.right
} }
} }
states: [ states: [
@ -120,7 +114,6 @@ Item {
anchors.topMargin: 15 anchors.topMargin: 15
anchors.leftMargin: 10 anchors.leftMargin: 10
} }
}, },
State { State {
name: "containsText" name: "containsText"
@ -133,7 +126,6 @@ Item {
anchors.topMargin: 0 anchors.topMargin: 0
anchors.leftMargin: 0 anchors.leftMargin: 0
} }
}, },
State { State {
name: "containsTextEditingFinished" name: "containsTextEditingFinished"
@ -146,7 +138,6 @@ Item {
anchors.topMargin: 0 anchors.topMargin: 0
anchors.leftMargin: 0 anchors.leftMargin: 0
} }
} }
] ]
transitions: [ transitions: [
@ -161,7 +152,6 @@ Item {
easing.type: Easing.InOutQuart easing.type: Easing.InOutQuart
properties: "font.pointSize,anchors.topMargin,anchors.leftMargin,opacity,color" properties: "font.pointSize,anchors.topMargin,anchors.leftMargin,opacity,color"
} }
}, },
Transition { Transition {
from: "containsText" from: "containsText"
@ -174,7 +164,6 @@ Item {
easing.type: Easing.OutSine easing.type: Easing.OutSine
properties: "color,opacity" properties: "color,opacity"
} }
} }
] ]
} }

View File

@ -14,16 +14,16 @@ SystemTrayIcon {
onActivated: function (reason) { onActivated: function (reason) {
switch (reason) { switch (reason) {
case SystemTrayIcon.Unknown: case SystemTrayIcon.Unknown:
break break;
case SystemTrayIcon.Context: case SystemTrayIcon.Context:
break break;
case SystemTrayIcon.DoubleClick: case SystemTrayIcon.DoubleClick:
window.show() window.show();
break break;
case SystemTrayIcon.Trigger: case SystemTrayIcon.Trigger:
break break;
case SystemTrayIcon.MiddleClick: case SystemTrayIcon.MiddleClick:
break break;
} }
} }
@ -32,7 +32,7 @@ SystemTrayIcon {
text: qsTr("Open ScreenPlay") text: qsTr("Open ScreenPlay")
onTriggered: { onTriggered: {
App.showDockIcon(true); App.showDockIcon(true);
window.show() window.show();
} }
} }
@ -44,15 +44,13 @@ SystemTrayIcon {
text: qsTr("Mute all") text: qsTr("Mute all")
onTriggered: { onTriggered: {
if (miMuteAll.isMuted) { if (miMuteAll.isMuted) {
isMuted = false isMuted = false;
miMuteAll.text = qsTr("Mute all") miMuteAll.text = qsTr("Mute all");
App.screenPlayManager.setAllWallpaperValue("muted", App.screenPlayManager.setAllWallpaperValue("muted", "true");
"true")
} else { } else {
isMuted = true isMuted = true;
miMuteAll.text = qsTr("Unmute all") miMuteAll.text = qsTr("Unmute all");
App.screenPlayManager.setAllWallpaperValue("muted", App.screenPlayManager.setAllWallpaperValue("muted", "false");
"false")
} }
} }
} }
@ -65,15 +63,13 @@ SystemTrayIcon {
text: qsTr("Pause all") text: qsTr("Pause all")
onTriggered: { onTriggered: {
if (miStopAll.isPlaying) { if (miStopAll.isPlaying) {
isPlaying = false isPlaying = false;
miStopAll.text = qsTr("Pause all") miStopAll.text = qsTr("Pause all");
App.screenPlayManager.setAllWallpaperValue( App.screenPlayManager.setAllWallpaperValue("isPlaying", "true");
"isPlaying", "true")
} else { } else {
isPlaying = true isPlaying = true;
miStopAll.text = qsTr("Play all") miStopAll.text = qsTr("Play all");
App.screenPlayManager.setAllWallpaperValue( App.screenPlayManager.setAllWallpaperValue("isPlaying", "false");
"isPlaying", "false")
} }
} }
} }

View File

@ -87,7 +87,7 @@ bool ProjectFile::init()
if (obj.contains("codec")) { if (obj.contains("codec")) {
if (auto videoCodecOpt = ScreenPlayUtil::getVideoCodecFromString(obj.value("codec").toString())) { if (auto videoCodecOpt = ScreenPlayUtil::getVideoCodecFromString(obj.value("codec").toString())) {
videoCodec = videoCodecOpt.value(); videoCodec = videoCodecOpt.value();
} else{ } else {
qWarning("Invalid videoCodec was specified inside the json object!"); qWarning("Invalid videoCodec was specified inside the json object!");
} }
} else if (type == ScreenPlay::InstalledType::InstalledType::VideoWallpaper) { } else if (type == ScreenPlay::InstalledType::InstalledType::VideoWallpaper) {

View File

@ -20,27 +20,27 @@ Rectangle {
font.pixelSize: 50 font.pixelSize: 50
} }
OpacityAnimator on opacity{ OpacityAnimator on opacity {
id: createAnimation id: createAnimation
from: 0; from: 0
to: 1; to: 1
duration: 1000 duration: 1000
onRunningChanged: { onRunningChanged: {
if(!running){ if (!running) {
toBeDeleted.opacity = 1 toBeDeleted.opacity = 1;
toBeCreated.opacity = 0 toBeCreated.opacity = 0;
destroyAnimation.start() destroyAnimation.start();
} }
} }
} }
Component.onCompleted: { Component.onCompleted: {
createAnimation.start() createAnimation.start();
} }
} }
Rectangle { Rectangle {
opacity: 0
id: toBeDeleted id: toBeDeleted
opacity: 0
anchors.fill: parent anchors.fill: parent
color: "black" color: "black"
@ -54,21 +54,19 @@ Rectangle {
font.pixelSize: 50 font.pixelSize: 50
} }
OpacityAnimator on opacity{ OpacityAnimator on opacity {
id: destroyAnimation id: destroyAnimation
from: 1; from: 1
to: 0; to: 0
duration: 1000 duration: 1000
running: false running: false
onRunningChanged: { onRunningChanged: {
if(!running){ if (!running) {
toBeDeleted.opacity = 0 toBeDeleted.opacity = 0;
toBeCreated.opacity = 0 toBeCreated.opacity = 0;
createAnimation.start() createAnimation.start();
} }
} }
} }
} }
} }

View File

@ -5,7 +5,6 @@ import QtWebEngine 1.8
import QtMultimedia 5.12 import QtMultimedia 5.12
import Qt.labs.settings 1.1 import Qt.labs.settings 1.1
Rectangle { Rectangle {
id: root id: root
color: "black" color: "black"
@ -18,25 +17,25 @@ Rectangle {
property string projectSourceFileAbsolute property string projectSourceFileAbsolute
property bool loops: true property bool loops: true
function stop(){ function stop() {
player1.stop() player1.stop();
player2.stop() player2.stop();
videoOutput1.visible = false videoOutput1.visible = false;
videoOutput2.visible = false videoOutput2.visible = false;
root.enabled = false root.enabled = false;
} }
function play(){ function play() {
root.enabled = true root.enabled = true;
videoOutput2.visible = false videoOutput2.visible = false;
videoOutput1.visible = true videoOutput1.visible = true;
//if(wallpaper.configuration.DualPlayback){ //if(wallpaper.configuration.DualPlayback){
player2.source = root.projectSourceFileAbsolute player2.source = root.projectSourceFileAbsolute;
player2.play() player2.play();
player2.pause() player2.pause();
//} //}
player1.play() player1.play();
} }
MediaPlayer { MediaPlayer {
@ -44,17 +43,16 @@ Rectangle {
volume: root.volume volume: root.volume
source: root.projectSourceFileAbsolute source: root.projectSourceFileAbsolute
onStopped: { onStopped: {
if(!root.enabled) if (!root.enabled)
return return;
videoOutput1.visible = false;
videoOutput1.visible = false videoOutput2.visible = true;
videoOutput2.visible = true if (player2.source !== root.projectSourceFileAbsolute) {
if(player2.source !== root.projectSourceFileAbsolute){ player2.source = root.projectSourceFileAbsolute;
player2.source = root.projectSourceFileAbsolute }
} player1.play();
player1.play() player1.pause();
player1.pause() player2.play();
player2.play()
} }
} }
@ -62,17 +60,16 @@ Rectangle {
id: player2 id: player2
volume: root.volume volume: root.volume
onStopped: { onStopped: {
if(!root.enabled) if (!root.enabled)
return return;
videoOutput2.visible = false videoOutput2.visible = false;
videoOutput1.visible = true videoOutput1.visible = true;
player2.play() player2.play();
player2.pause() player2.pause();
player1.play() player1.play();
} }
} }
VideoOutput { VideoOutput {
id: videoOutput1 id: videoOutput1
fillMode: VideoOutput.PreserveAspectCrop fillMode: VideoOutput.PreserveAspectCrop
@ -86,7 +83,4 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
source: player2 source: player2
} }
} }

View File

@ -4,7 +4,6 @@ import QtWebSockets 1.1
import QtWebEngine 1.8 import QtWebEngine 1.8
import QtMultimedia 5.12 import QtMultimedia 5.12
Rectangle { Rectangle {
id: container id: container
anchors.fill: parent anchors.fill: parent
@ -16,27 +15,27 @@ Rectangle {
property bool connected: false property bool connected: false
Timer { Timer {
id: connectTimer id: connectTimer
interval: 1000 interval: 1000
running: true running: true
repeat: true repeat: true
onTriggered: { onTriggered: {
if(!wp.connected){ if (!wp.connected) {
console.log("not connected") console.log("not connected");
wp.source = "" wp.source = "";
wp.source = "Wallpaper.qml" wp.source = "Wallpaper.qml";
} else { } else {
console.log("connected") console.log("connected");
screensaver.visible = false screensaver.visible = false;
connectTimer.stop() connectTimer.stop();
} }
} }
} }
} }
Loader { Loader {
anchors.fill: parent
id: screensaver id: screensaver
anchors.fill: parent
source: "WaitingForScreenplay.qml" source: "WaitingForScreenplay.qml"
} }
} }

View File

@ -8,13 +8,11 @@ import org.kde.kcm 1.1 as KCM
import org.kde.kirigami 2.4 as Kirigami import org.kde.kirigami 2.4 as Kirigami
import org.kde.newstuff 1.1 as NewStuff import org.kde.newstuff 1.1 as NewStuff
Column { Column {
id: root id: root
property alias cfg_MonitorIndex: monitorIndex.text property alias cfg_MonitorIndex: monitorIndex.text
anchors.fill: parent anchors.fill: parent
spacing: units.largeSpacing spacing: units.largeSpacing
@ -26,8 +24,5 @@ Column {
id: monitorIndex id: monitorIndex
text: "0" text: "0"
} }
} }
} }

View File

@ -4,55 +4,51 @@ import QtWebSockets 1.1
import QtWebEngine 1.8 import QtWebEngine 1.8
import QtMultimedia 5.12 import QtMultimedia 5.12
import Qt.labs.settings 1.1 import Qt.labs.settings 1.1
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
Rectangle { Rectangle {
id:root id: root
color:"orange" color: "orange"
property bool connected: false property bool connected: false
Settings { Settings {
id:settings id: settings
} }
Component.onCompleted: { Component.onCompleted: {
wallpaper.projectSourceFileAbsolute = settings.value("SP_projectSourceFileAbsolute","NULL") wallpaper.projectSourceFileAbsolute = settings.value("SP_projectSourceFileAbsolute", "NULL");
// if(root.projectSourceFileAbsolute === "NULL") // if(root.projectSourceFileAbsolute === "NULL")
// return // return
wallpaper.type = settings.value("SP_type");
wallpaper.type = settings.value("SP_type") wallpaper.fillMode = settings.value("SP_fillMode");
wallpaper.fillMode = settings.value("SP_fillMode")
//wallpaper.volume = settings.value("SP_volume") //wallpaper.volume = settings.value("SP_volume")
wallpaper.play() wallpaper.play();
} }
Wallpaper { Wallpaper {
id:wallpaper id: wallpaper
anchors.fill: parent anchors.fill: parent
// visible: root.connected
onFullContentPathChanged: settings.setValue("SP_fullContentPath",fullContentPath)
onVolumeChanged: settings.setValue("SP_volume",volume)
onFillModeChanged: settings.setValue("SP_fillMode",fillMode)
onTypeChanged: settings.setValue("SP_type",type)
onProjectSourceFileAbsoluteChanged: settings.setValue("SP_projectSourceFileAbsolute",projectSourceFileAbsolute)
onLoopsChanged: settings.setValue("SP_loops",loops)
// visible: root.connected
onFullContentPathChanged: settings.setValue("SP_fullContentPath", fullContentPath)
onVolumeChanged: settings.setValue("SP_volume", volume)
onFillModeChanged: settings.setValue("SP_fillMode", fillMode)
onTypeChanged: settings.setValue("SP_type", type)
onProjectSourceFileAbsoluteChanged: settings.setValue("SP_projectSourceFileAbsolute", projectSourceFileAbsolute)
onLoopsChanged: settings.setValue("SP_loops", loops)
} }
Timer { Timer {
id:reconnectTimer id: reconnectTimer
interval: 1000 interval: 1000
running: true running: true
repeat: true repeat: true
onTriggered: { onTriggered: {
if (socket.status === WebSocket.Open) if (socket.status === WebSocket.Open)
return return;
socket.active = false socket.active = false;
socket.active = true socket.active = true;
reconnectTimer.retryCounter += 1 reconnectTimer.retryCounter += 1;
} }
property int retryCounter: 0 property int retryCounter: 0
} }
@ -61,35 +57,33 @@ Rectangle {
id: socket id: socket
url: "ws://127.0.0.1:16395" url: "ws://127.0.0.1:16395"
onStatusChanged: { onStatusChanged: {
if (socket.status === WebSocket.Open) if (socket.status === WebSocket.Open)
socket.sendTextMessage("Hello World from QML wallpaper") socket.sendTextMessage("Hello World from QML wallpaper");
} }
onTextMessageReceived: (message)=> { onTextMessageReceived: message => {
var obj = JSON.parse(message);
var obj = JSON.parse(message) root.connected = true;
root.connected = true txtCommand.text = obj.command;
txtCommand.text = obj.command
if (obj.command === "replace") { if (obj.command === "replace") {
socket.sendTextMessage("replace") socket.sendTextMessage("replace");
wallpaper.type = obj.type wallpaper.type = obj.type;
wallpaper.fillMode = obj.fillMode wallpaper.fillMode = obj.fillMode;
wallpaper.volume = obj.volume wallpaper.volume = obj.volume;
wallpaper.projectSourceFileAbsolute = "file://" + obj.absolutePath + "/" + obj.file wallpaper.projectSourceFileAbsolute = "file://" + obj.absolutePath + "/" + obj.file;
print("got: " + root.projectSourceFileAbsolute) print("got: " + root.projectSourceFileAbsolute);
wallpaper.play() wallpaper.play();
return; return;
} }
if(obj.command === "quit"){ if (obj.command === "quit") {
wallpaper.stop() wallpaper.stop();
} }
} }
} }
// WaitingForScreenplay { // WaitingForScreenplay {
// anchors.fill: parent // anchors.fill: parent
// visible: !root.connected // visible: !root.connected
// } // }
Column { Column {
anchors { anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
@ -97,7 +91,7 @@ Rectangle {
margins: 60 margins: 60
} }
Text { Text {
id:txtCommand id: txtCommand
color: "white" color: "white"
} }
Text { Text {
@ -106,20 +100,15 @@ Rectangle {
} }
Text { Text {
color: "white" color: "white"
text: "projectSourceFileAbsolute " + wallpaper.projectSourceFileAbsolute text: "projectSourceFileAbsolute " + wallpaper.projectSourceFileAbsolute
} }
Text { Text {
color: "white" color: "white"
text:"reconnectTimer.retryCounter : "+ reconnectTimer.retryCounter text: "reconnectTimer.retryCounter : " + reconnectTimer.retryCounter
} }
Text { Text {
color: "white" color: "white"
text: "MonitorIndex: " + wallpaper.configuration.MonitorIndex text: "MonitorIndex: " + wallpaper.configuration.MonitorIndex
} }
} }
} }

View File

@ -10,15 +10,14 @@ Item {
property string fillMode: Wallpaper.fillMode property string fillMode: Wallpaper.fillMode
onFillModeChanged: { onFillModeChanged: {
// Convert Web based video modes to the limited Qt fillModes // Convert Web based video modes to the limited Qt fillModes
if (fillMode === "cover" || fillMode === "stretch" if (fillMode === "cover" || fillMode === "stretch" || fillMode === "contain") {
|| fillMode === "contain") { return vo.fillMode = VideoOutput.Stretch;
return vo.fillMode = VideoOutput.Stretch
} }
if (fillMode === "fill") { if (fillMode === "fill") {
return vo.fillMode = VideoOutput.PreserveAspectFit return vo.fillMode = VideoOutput.PreserveAspectFit;
} }
if (fillMode === "scale_down") { if (fillMode === "scale_down") {
return vo.fillMode = VideoOutput.PreserveAspectCrop return vo.fillMode = VideoOutput.PreserveAspectCrop;
} }
} }
@ -29,18 +28,18 @@ Item {
property string source: Wallpaper.projectSourceFileAbsolute property string source: Wallpaper.projectSourceFileAbsolute
onSourceChanged: { onSourceChanged: {
// Qt 6.3 workaround // Qt 6.3 workaround
mediaPlayer.stop() mediaPlayer.stop();
mediaPlayer.source = Qt.resolvedUrl(root.source) mediaPlayer.source = Qt.resolvedUrl(root.source);
mediaPlayer.play() mediaPlayer.play();
} }
MediaPlayer { MediaPlayer {
id: mediaPlayer id: mediaPlayer
onPlaybackStateChanged:{ onPlaybackStateChanged: {
if( mediaPlayer.playbackState == MediaPlayer.PlayingState){ if (mediaPlayer.playbackState == MediaPlayer.PlayingState) {
root.ready = true root.ready = true;
} }
} }
loops: root.loops ? MediaPlayer.Infinite : 1 loops: root.loops ? MediaPlayer.Infinite : 1
videoOutput: vo videoOutput: vo
audioOutput: ao audioOutput: ao
@ -59,21 +58,20 @@ Item {
Connections { Connections {
function onFillModeChanged(fillMode) { function onFillModeChanged(fillMode) {
if (fillMode === "stretch") { if (fillMode === "stretch") {
vo.fillMode = VideoOutput.Stretch vo.fillMode = VideoOutput.Stretch;
return return;
} }
if (fillMode === "fill") { if (fillMode === "fill") {
vo.fillMode = VideoOutput.PreserveAspectFit vo.fillMode = VideoOutput.PreserveAspectFit;
return return;
} }
if (fillMode === "contain" || fillMode === "cover" if (fillMode === "contain" || fillMode === "cover" || fillMode === "scale-down") {
|| fillMode === "scale-down") { vo.fillMode = VideoOutput.PreserveAspectCrop;
vo.fillMode = VideoOutput.PreserveAspectCrop
} }
} }
function onCurrentTimeChanged(currentTime) { function onCurrentTimeChanged(currentTime) {
mediaPlayer.position = currentTime * mediaPlayer.duration mediaPlayer.position = currentTime * mediaPlayer.duration;
} }
target: Wallpaper target: Wallpaper

View File

@ -3,7 +3,6 @@ import QtWebEngine
import ScreenPlay.Enums.InstalledType import ScreenPlay.Enums.InstalledType
import ScreenPlayWallpaper import ScreenPlayWallpaper
/*! /*!
* The native macOS multimedia stack does not support VP8/VP9. For this we must use the WebEngine. * The native macOS multimedia stack does not support VP8/VP9. For this we must use the WebEngine.
*/ */
@ -15,44 +14,42 @@ Item {
function getSetVideoCommand() { function getSetVideoCommand() {
// TODO 30: // TODO 30:
// Currently wont work. Commit anyways til QtCreator and Qt work with js template literals // Currently wont work. Commit anyways til QtCreator and Qt work with js template literals
var src = "" var src = "";
src += "var videoPlayer = document.getElementById('videoPlayer');" src += "var videoPlayer = document.getElementById('videoPlayer');";
src += "var videoSource = document.getElementById('videoSource');" src += "var videoSource = document.getElementById('videoSource');";
src += "videoSource.src = '" + Wallpaper.projectSourceFileAbsolute + "';" src += "videoSource.src = '" + Wallpaper.projectSourceFileAbsolute + "';";
src += "videoPlayer.load();" src += "videoPlayer.load();";
src += "videoPlayer.volume = " + Wallpaper.volume + ";" src += "videoPlayer.volume = " + Wallpaper.volume + ";";
src += "videoPlayer.setAttribute('style', 'object-fit :" + Wallpaper.fillMode + ";');" src += "videoPlayer.setAttribute('style', 'object-fit :" + Wallpaper.fillMode + ";');";
src += "videoPlayer.play();" src += "videoPlayer.play();";
print(src) print(src);
return src return src;
} }
Component.onCompleted: { Component.onCompleted: {
WebEngine.settings.localContentCanAccessFileUrls = true WebEngine.settings.localContentCanAccessFileUrls = true;
WebEngine.settings.localContentCanAccessRemoteUrls = true WebEngine.settings.localContentCanAccessRemoteUrls = true;
WebEngine.settings.allowRunningInsecureContent = true WebEngine.settings.allowRunningInsecureContent = true;
WebEngine.settings.accelerated2dCanvasEnabled = true WebEngine.settings.accelerated2dCanvasEnabled = true;
WebEngine.settings.javascriptCanOpenWindows = false WebEngine.settings.javascriptCanOpenWindows = false;
WebEngine.settings.showScrollBars = false WebEngine.settings.showScrollBars = false;
WebEngine.settings.playbackRequiresUserGesture = false WebEngine.settings.playbackRequiresUserGesture = false;
WebEngine.settings.focusOnNavigationEnabled = true WebEngine.settings.focusOnNavigationEnabled = true;
} }
WebEngineView { WebEngineView {
id: webView id: webView
anchors.fill: parent anchors.fill: parent
url: Qt.resolvedUrl("file://" + Wallpaper.getApplicationPath( url: Qt.resolvedUrl("file://" + Wallpaper.getApplicationPath() + "/index.html")
) + "/index.html")
onJavaScriptConsoleMessage: function (lineNumber, message) { onJavaScriptConsoleMessage: function (lineNumber, message) {
print(lineNumber, message) print(lineNumber, message);
} }
onLoadProgressChanged: { onLoadProgressChanged: {
if (loadProgress === 100) { if (loadProgress === 100) {
webView.runJavaScript(root.getSetVideoCommand(), webView.runJavaScript(root.getSetVideoCommand(), function (result) {
function (result) { requestFadeIn();
requestFadeIn() });
})
} }
} }
} }
@ -75,79 +72,68 @@ Item {
interval: 300 interval: 300
onTriggered: { onTriggered: {
webView.visible = !Wallpaper.visualsPaused webView.visible = !Wallpaper.visualsPaused;
txtVisualsPaused.visible = Wallpaper.visualsPaused txtVisualsPaused.visible = Wallpaper.visualsPaused;
} }
} }
Connections { Connections {
function onReloadVideo(oldType) { function onReloadVideo(oldType) {
webView.runJavaScript(root.getSetVideoCommand()) webView.runJavaScript(root.getSetVideoCommand());
} }
function onQmlExit() { function onQmlExit() {
webView.runJavaScript( webView.runJavaScript("var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.volume = 0;");
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.volume = 0;")
} }
function onMutedChanged(muted) { function onMutedChanged(muted) {
if (muted) if (muted)
webView.runJavaScript( webView.runJavaScript("var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.volume = 0;");
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.volume = 0;")
else else
webView.runJavaScript( webView.runJavaScript("var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.volume = " + Wallpaper.volume + ";");
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.volume = " + Wallpaper.volume + ";")
} }
function onFillModeChanged(fillMode) { function onFillModeChanged(fillMode) {
if (webView.loadProgress === 100) if (webView.loadProgress === 100)
webView.runJavaScript( webView.runJavaScript("var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.setAttribute('style', 'object-fit :" + fillMode + ";');");
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.setAttribute('style', 'object-fit :" + fillMode + ";');")
} }
function onLoopsChanged(loops) { function onLoopsChanged(loops) {
if (webView.loadProgress === 100) if (webView.loadProgress === 100)
webView.runJavaScript( webView.runJavaScript("var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.loop = " + loops + ";");
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.loop = " + loops + ";")
} }
function onVolumeChanged(volume) { function onVolumeChanged(volume) {
if (webView.loadProgress === 100) if (webView.loadProgress === 100)
webView.runJavaScript( webView.runJavaScript("var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.volume = " + volume + ";");
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.volume = " + volume + ";")
} }
function onCurrentTimeChanged(currentTime) { function onCurrentTimeChanged(currentTime) {
if (webView.loadProgress === 100) if (webView.loadProgress === 100)
webView.runJavaScript( webView.runJavaScript("var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.currentTime = " + currentTime + " * videoPlayer.duration;");
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.currentTime = "
+ currentTime + " * videoPlayer.duration;")
} }
function onPlaybackRateChanged(playbackRate) { function onPlaybackRateChanged(playbackRate) {
if (webView.loadProgress === 100) if (webView.loadProgress === 100)
webView.runJavaScript( webView.runJavaScript("var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.playbackRate = " + playbackRate + ";");
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.playbackRate = " + playbackRate + ";")
} }
function onVisualsPausedChanged(visualsPaused) { function onVisualsPausedChanged(visualsPaused) {
if (visualsPaused) { if (visualsPaused) {
// Wait until Wallpaper animation is finsihed // Wait until Wallpaper animation is finsihed
timerCover.restart() timerCover.restart();
} else { } else {
webView.visible = true webView.visible = true;
txtVisualsPaused.visible = false txtVisualsPaused.visible = false;
} }
} }
function onIsPlayingChanged(isPlaying) { function onIsPlayingChanged(isPlaying) {
if (webView.loadProgress === 100) { if (webView.loadProgress === 100) {
if (isPlaying) if (isPlaying)
webView.runJavaScript( webView.runJavaScript("var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.play();");
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.play();")
else else
webView.runJavaScript( webView.runJavaScript("var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.pause();");
"var videoPlayer = document.getElementById('videoPlayer'); videoPlayer.pause();")
} }
} }

View File

@ -33,10 +33,10 @@ Rectangle {
id: ma id: ma
function setPosition() { function setPosition() {
attractor.pointX = mouseX - 25 attractor.pointX = mouseX - 25;
attractor.pointY = mouseY - 25 attractor.pointY = mouseY - 25;
mouseDot.x = mouseX - mouseDot.center mouseDot.x = mouseX - mouseDot.center;
mouseDot.y = mouseY - mouseDot.center mouseDot.y = mouseY - mouseDot.center;
} }
anchors.fill: parent anchors.fill: parent
@ -44,14 +44,13 @@ Rectangle {
propagateComposedEvents: true propagateComposedEvents: true
hoverEnabled: true hoverEnabled: true
Component.onCompleted: { Component.onCompleted: {
attractor.pointX = parent.width * 0.5 attractor.pointX = parent.width * 0.5;
attractor.pointY = parent.height * 0.5 attractor.pointY = parent.height * 0.5;
} }
onPositionChanged: { onPositionChanged: {
setPosition() setPosition();
} }
onClicked: { onClicked: {
} }
} }
@ -179,10 +178,10 @@ Rectangle {
highlighted: true highlighted: true
text: qsTr("Click me! - 1") text: qsTr("Click me! - 1")
onClicked: { onClicked: {
focus = false focus = false;
focus = true focus = true;
print("Button Clicked!") print("Button Clicked!");
txtButtonConter.counter = txtButtonConter.counter - 1 txtButtonConter.counter = txtButtonConter.counter - 1;
} }
} }
@ -190,10 +189,10 @@ Rectangle {
highlighted: true highlighted: true
text: qsTr("Exit Wallpaper") text: qsTr("Exit Wallpaper")
onClicked: { onClicked: {
focus = false focus = false;
focus = true focus = true;
print("Exit Wallpaper") print("Exit Wallpaper");
Wallpaper.terminate() Wallpaper.terminate();
} }
} }
@ -202,8 +201,8 @@ Rectangle {
focusPolicy: Qt.ClickFocus focusPolicy: Qt.ClickFocus
text: qsTr("Click me! +1") text: qsTr("Click me! +1")
onClicked: { onClicked: {
print("Button Clicked!") print("Button Clicked!");
txtButtonConter.counter = txtButtonConter.counter + 1 txtButtonConter.counter = txtButtonConter.counter + 1;
} }
} }
} }

View File

@ -11,175 +11,159 @@ Rectangle {
property bool canFadeByWallpaperFillMode: true property bool canFadeByWallpaperFillMode: true
function init() { function init() {
fadeInImageSetup() fadeInImageSetup();
switch (Wallpaper.type) { switch (Wallpaper.type) {
case InstalledType.VideoWallpaper: case InstalledType.VideoWallpaper:
if (Wallpaper.videoCodec === VideoCodec.Unknown) { if (Wallpaper.videoCodec === VideoCodec.Unknown) {
Wallpaper.terminate() Wallpaper.terminate();
} }
// macOS only supports h264 via the native Qt MM // macOS only supports h264 via the native Qt MM
if (Qt.platform.os === "osx") { if (Qt.platform.os === "osx") {
if ((Wallpaper.videoCodec === VideoCodec.VP8 if ((Wallpaper.videoCodec === VideoCodec.VP8 || Wallpaper.videoCodec === VideoCodec.VP9)) {
|| Wallpaper.videoCodec === VideoCodec.VP9)) { loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaWebView.qml";
loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaWebView.qml"
} else { } else {
loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaView.qml" loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaView.qml";
} }
} }
if (Qt.platform.os === "windows") { if (Qt.platform.os === "windows") {
loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaView.qml" loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaView.qml";
} }
break;
break
case InstalledType.HTMLWallpaper: case InstalledType.HTMLWallpaper:
loader.setSource( loader.setSource("qrc:/qml/ScreenPlayWallpaper/qml/WebsiteWallpaper.qml", {
"qrc:/qml/ScreenPlayWallpaper/qml/WebsiteWallpaper.qml", "url": Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute)
{ });
"url": Qt.resolvedUrl( break;
Wallpaper.projectSourceFileAbsolute)
})
break
case InstalledType.QMLWallpaper: case InstalledType.QMLWallpaper:
loader.source = Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute) loader.source = Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute);
break break;
case InstalledType.WebsiteWallpaper: case InstalledType.WebsiteWallpaper:
loader.setSource( loader.setSource("qrc:/qml/ScreenPlayWallpaper/qml/WebsiteWallpaper.qml", {
"qrc:/qml/ScreenPlayWallpaper/qml/WebsiteWallpaper.qml", "url": Wallpaper.projectSourceFileAbsolute
{ });
"url": Wallpaper.projectSourceFileAbsolute break;
})
break
case InstalledType.GifWallpaper: case InstalledType.GifWallpaper:
loader.setSource( loader.setSource("qrc:/qml/ScreenPlayWallpaper/qml/GifWallpaper.qml", {
"qrc:/qml/ScreenPlayWallpaper/qml/GifWallpaper.qml", { "source": Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute)
"source": Qt.resolvedUrl( });
Wallpaper.projectSourceFileAbsolute) break;
})
break
} }
} }
function fadeInImageSetup(){ function fadeInImageSetup() {
if (Qt.platform.os !== "windows") { if (Qt.platform.os !== "windows") {
root.canFadeByWallpaperFillMode = false root.canFadeByWallpaperFillMode = false;
return return;
} }
imgCover.source = Qt.resolvedUrl("file:///" + Wallpaper.windowsDesktopProperties.wallpaperPath);
imgCover.source = Qt.resolvedUrl("file:///" + Wallpaper.windowsDesktopProperties.wallpaperPath) switch (Wallpaper.windowsDesktopProperties.wallpaperStyle) {
case 10:
switch (Wallpaper.windowsDesktopProperties.wallpaperStyle) { imgCover.fillMode = Image.PreserveAspectCrop;
case 10: // We only support fade in for one screen
imgCover.fillMode = Image.PreserveAspectCrop if (Wallpaper.activeScreensList.length !== 1)
// We only support fade in for one screen return;
if (Wallpaper.activeScreensList.length !== 1) if (Wallpaper.width === 0)
return return;
if (Wallpaper.width === 0) if (Wallpaper.width > Wallpaper.windowsDesktopProperties.defaultWallpaperSize.width)
return return;
if (Wallpaper.width > Wallpaper.windowsDesktopProperties.defaultWallpaperSize.width) // Windows does some weird top margin if the Wallpaper
return // is bigger than the monitor. So instead of centering
// it vertically it moves the wallpaper down by 1/3 of
// Windows does some weird top margin if the Wallpaper // the remaining height.
// is bigger than the monitor. So instead of centering // 1. Scale down the wallpaper based on the height.
// it vertically it moves the wallpaper down by 1/3 of // The default Windows 11 wallpaper C:\Windows\Web\Wallpaper\Windows\img19.jpg
// the remaining height. // has a resoltion of 3841x2400 scaled down to 3440x2150,3 with a given monitor
// 1. Scale down the wallpaper based on the height. // resolution of 3440x1440 resulting in a 2150,3 - 1440 = 710,3
// The default Windows 11 wallpaper C:\Windows\Web\Wallpaper\Windows\img19.jpg // 710,3 / (1/3) = 236,767
// has a resoltion of 3841x2400 scaled down to 3440x2150,3 with a given monitor const monitorWidth = Wallpaper.width;
// resolution of 3440x1440 resulting in a 2150,3 - 1440 = 710,3 const monitorHeight = Wallpaper.height;
// 710,3 / (1/3) = 236,767 const windowsWallpaperWidth = Wallpaper.windowsDesktopProperties.defaultWallpaperSize.width;
const monitorWidth = Wallpaper.width const windowsWallpapeHeight = Wallpaper.windowsDesktopProperties.defaultWallpaperSize.height;
const monitorHeight = Wallpaper.height
const windowsWallpaperWidth = Wallpaper.windowsDesktopProperties.defaultWallpaperSize.width // 1. Get scale factor:
const windowsWallpapeHeight = Wallpaper.windowsDesktopProperties.defaultWallpaperSize.height // -> 3440 / 3840 = 0.8956
const scaleFactor = monitorWidth / windowsWallpaperWidth;
// 1. Get scale factor: // 2. Scale down the default Windows wallpaper height (width stays the same for correct aspect ratio):
// -> 3440 / 3840 = 0.8956 // -> 2400 * 0.8956 = 2149.4
const scaleFactor = monitorWidth / windowsWallpaperWidth const scaledDownDefaultWallpaperHeight = windowsWallpapeHeight * scaleFactor;
// 2. Scale down the default Windows wallpaper height (width stays the same for correct aspect ratio): // 3. Calc offste
// -> 2400 * 0.8956 = 2149.4 // -> 2150,3 - 1440 = 710,3
const scaledDownDefaultWallpaperHeight = windowsWallpapeHeight * scaleFactor const offset = scaledDownDefaultWallpaperHeight - monitorHeight;
// 3. Calc offste // 4. Calc the one third offset (topMargin)
// -> 2150,3 - 1440 = 710,3 // -> 710,3 * (1/3) = 236,767
const offset = scaledDownDefaultWallpaperHeight - monitorHeight const topMargin = Math.floor(offset * 0.3333333);
// 4. Calc the one third offset (topMargin) imgCover.anchors.topMargin = -topMargin;
// -> 710,3 * (1/3) = 236,767 break;
const topMargin = Math.floor(offset * 0.3333333) case 6:
imgCover.anchors.topMargin = -topMargin imgCover.fillMode = Image.PreserveAspectFit;
break;
break case 2:
case 6: break;
imgCover.fillMode = Image.PreserveAspectFit case 0:
break if (desktopProperties.isTiled) {
case 2: // Tiled
break imgCover.fillMode = Image.Tile;
case 0: } else {
if (desktopProperties.isTiled) { // Center
// Tiled imgCover.fillMode = Image.PreserveAspectFit;
imgCover.fillMode = Image.Tile imgCover.anchors.centerIn = parent;
} else { imgCover.width = sourceSize.width;
// Center imgCover.height = sourceSize.height;
imgCover.fillMode = Image.PreserveAspectFit
imgCover.anchors.centerIn = parent
imgCover.width = sourceSize.width
imgCover.height = sourceSize.height
}
break
case 22:
root.canFadeByWallpaperFillMode = false
break
} }
break;
case 22:
root.canFadeByWallpaperFillMode = false;
break;
}
} }
function fadeIn() { function fadeIn() {
Wallpaper.setVisible(true) Wallpaper.setVisible(true);
if (canFadeByWallpaperFillMode && Wallpaper.canFade) if (canFadeByWallpaperFillMode && Wallpaper.canFade)
imgCover.state = "hideDefaultBackgroundImage" imgCover.state = "hideDefaultBackgroundImage";
else else
imgCover.opacity = 0 imgCover.opacity = 0;
} }
anchors.fill: parent anchors.fill: parent
color: { color: {
if (Qt.platform.os !== "windows") if (Qt.platform.os !== "windows")
return "black" return "black";
else else
return Wallpaper.windowsDesktopProperties.color return Wallpaper.windowsDesktopProperties.color;
} }
Component.onCompleted: { Component.onCompleted: {
init() init();
} }
Connections { Connections {
function onQmlExit() { function onQmlExit() {
if (canFadeByWallpaperFillMode && Wallpaper.canFade) if (canFadeByWallpaperFillMode && Wallpaper.canFade)
imgCover.state = "exit" imgCover.state = "exit";
else else
Wallpaper.terminate() Wallpaper.terminate();
} }
function onQmlSceneValueReceived(key, value) { function onQmlSceneValueReceived(key, value) {
var obj2 = 'import QtQuick; Item {Component.onCompleted: loader.item.' var obj2 = 'import QtQuick; Item {Component.onCompleted: loader.item.' + key + ' = ' + value + '; }';
+ key + ' = ' + value + '; }' var newObject = Qt.createQmlObject(obj2.toString(), root, "err");
var newObject = Qt.createQmlObject(obj2.toString(), root, "err") newObject.destroy(10000);
newObject.destroy(10000)
} }
// Replace wallpaper with QML Scene // Replace wallpaper with QML Scene
function onReloadQML(oldType) { function onReloadQML(oldType) {
loader.sourceComponent = undefined loader.sourceComponent = undefined;
loader.source = "" loader.source = "";
Wallpaper.clearComponentCache() Wallpaper.clearComponentCache();
loader.source = Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute) loader.source = Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute);
} }
// Replace wallpaper with GIF // Replace wallpaper with GIF
function onReloadGIF(oldType) { function onReloadGIF(oldType) {
init() init();
} }
// This function only gets called here (the same function // This function only gets called here (the same function
@ -189,15 +173,13 @@ Rectangle {
// We need to check if the old type // We need to check if the old type
// was also Video not get called twice // was also Video not get called twice
if (oldType === InstalledType.VideoWallpaper) if (oldType === InstalledType.VideoWallpaper)
return return;
loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaView.qml";
loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaView.qml"
} }
target: Wallpaper target: Wallpaper
} }
Loader { Loader {
id: loader id: loader
anchors.fill: parent anchors.fill: parent
@ -205,17 +187,15 @@ Rectangle {
// an item. QApplication::quit(); waits for the destruction forever. // an item. QApplication::quit(); waits for the destruction forever.
//asynchronous: true //asynchronous: true
onStatusChanged: { onStatusChanged: {
if (loader.status === Loader.Ready ) { if (loader.status === Loader.Ready) {
if(loader.item.ready) if (loader.item.ready)
root.fadeIn() root.fadeIn();
} }
if (loader.status === Loader.Error) { if (loader.status === Loader.Error) {
loader.source = "" loader.source = "";
imgCover.state = "exit" imgCover.state = "exit";
} }
} }
} }
Image { Image {
@ -223,7 +203,7 @@ Rectangle {
state: "showDefaultBackgroundImage" state: "showDefaultBackgroundImage"
sourceSize.width: Wallpaper.width sourceSize.width: Wallpaper.width
sourceSize.height: Wallpaper.height sourceSize.height: Wallpaper.height
anchors { anchors {
top: parent.top top: parent.top
left: parent.left left: parent.left
@ -324,8 +304,7 @@ Rectangle {
} }
Text { Text {
text: "projectSourceFileAbsolute " + Qt.resolvedUrl( text: "projectSourceFileAbsolute " + Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute)
Wallpaper.projectSourceFileAbsolute)
font.pointSize: 14 font.pointSize: 14
} }
@ -362,10 +341,9 @@ Rectangle {
Text { Text {
text: { text: {
if (Qt.platform.os === "windows") if (Qt.platform.os === "windows")
return "imgCover.source " + Qt.resolvedUrl( return "imgCover.source " + Qt.resolvedUrl("file:///" + Wallpaper.windowsDesktopProperties.wallpaperPath);
"file:///" + Wallpaper.windowsDesktopProperties.wallpaperPath)
else else
return "" return "";
} }
font.pointSize: 14 font.pointSize: 14
} }

View File

@ -7,7 +7,7 @@ Item {
property string url property string url
signal requestFadeIn() signal requestFadeIn
Component.onCompleted: { Component.onCompleted: {
WebEngine.settings.localContentCanAccessFileUrls = true; WebEngine.settings.localContentCanAccessFileUrls = true;
@ -29,8 +29,6 @@ Item {
onLoadProgressChanged: { onLoadProgressChanged: {
if ((loadProgress === 100)) if ((loadProgress === 100))
root.requestFadeIn(); root.requestFadeIn();
} }
} }
} }

View File

@ -17,55 +17,56 @@ Window {
id: weather id: weather
city: "Friedrichshafen" city: "Friedrichshafen"
onReady: { onReady: {
rp.model = weather.days rp.model = weather.days;
// Qt bug https://bugreports.qt.io/browse/QTBUG-105137 // Qt bug https://bugreports.qt.io/browse/QTBUG-105137
test() test();
} }
} }
function test() {} function test() {
}
function mapWeatherCode(code) { function mapWeatherCode(code) {
const weather_time = "" // or "-day", "-night" const weather_time = ""; // or "-day", "-night"
const weather_prefix = "wi" + weather_time + "-" const weather_prefix = "wi" + weather_time + "-";
// https://open-meteo.com/en/docs // https://open-meteo.com/en/docs
// WMO Weather interpretation codes (WW) // WMO Weather interpretation codes (WW)
// to https://erikflowers.github.io/weather-icons/ // to https://erikflowers.github.io/weather-icons/
switch (code) { switch (code) {
case 0: case 0:
return weather_prefix + "day-sunny" return weather_prefix + "day-sunny";
case 1: case 1:
case 2: case 2:
case 3: case 3:
return weather_prefix + "cloud" return weather_prefix + "cloud";
case 45: case 45:
case 48: case 48:
return weather_prefix + "day-sunny" return weather_prefix + "day-sunny";
case 51: case 51:
case 53: case 53:
case 55: case 55:
return weather_prefix + "rain-mix" return weather_prefix + "rain-mix";
case 61: case 61:
case 63: case 63:
case 65: case 65:
return weather_prefix + "rain-mix" return weather_prefix + "rain-mix";
case 71: case 71:
case 73: case 73:
case 75: case 75:
return weather_prefix + "snow" return weather_prefix + "snow";
case 77: case 77:
return weather_prefix + "snow" return weather_prefix + "snow";
case 80: case 80:
case 81: case 81:
case 82: case 82:
return weather_prefix + "snow" return weather_prefix + "snow";
case 85: case 85:
case 86: case 86:
return weather_prefix + "snow" return weather_prefix + "snow";
case 95: case 95:
return weather_prefix + "thunderstorm" return weather_prefix + "thunderstorm";
case 96: case 96:
case 99: case 99:
return weather_prefix + "storm-showers" return weather_prefix + "storm-showers";
} }
} }
Rectangle { Rectangle {
@ -100,28 +101,7 @@ Window {
Text { Text {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: "longtitude: " + weather.longtitude + " - latitude: " text: "longtitude: " + weather.longtitude + " - latitude: " + weather.latitude + " - elevation: " + weather.elevation + "m - population: " + weather.population
+ weather.latitude + " - elevation: " + weather.elevation
+ "m - population: " + weather.population
}
component TextItem: Column {
property alias value: value.text
property alias text: description.text
Layout.preferredWidth: 120
Text {
id: value
width: 120
font.pointSize: 16
horizontalAlignment: Text.AlignHCenter
color: Material.primaryTextColor
}
Text {
id: description
horizontalAlignment: Text.AlignHCenter
color: Material.secondaryTextColor
width: 120
}
} }
RowLayout { RowLayout {
@ -159,8 +139,7 @@ Window {
} }
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
horizontalAlignment: Image.AlignHCenter horizontalAlignment: Image.AlignHCenter
source: "qrc:/qml/ScreenPlayWeather/assets/icons/" + root.mapWeatherCode( source: "qrc:/qml/ScreenPlayWeather/assets/icons/" + root.mapWeatherCode(weatherCode) + ".svg"
weatherCode) + ".svg"
} }
TextItem { TextItem {
text: "Weather Code" text: "Weather Code"
@ -188,4 +167,23 @@ Window {
} }
} }
} }
component TextItem: Column {
property alias value: value.text
property alias text: description.text
Layout.preferredWidth: 120
Text {
id: value
width: 120
font.pointSize: 16
horizontalAlignment: Text.AlignHCenter
color: Material.primaryTextColor
}
Text {
id: description
horizontalAlignment: Text.AlignHCenter
color: Material.secondaryTextColor
width: 120
}
}
} }

View File

@ -2,11 +2,10 @@ import QtQuick
import ScreenPlayWidget import ScreenPlayWidget
Rectangle { Rectangle {
implicitWidth: 500 implicitWidth: 500
implicitHeight: 300 implicitHeight: 300
color: "#80000000" color: "#80000000"
Text { Text {
id: name id: name
@ -18,5 +17,4 @@ Rectangle {
anchors.margins: 10 anchors.margins: 10
color: "white" color: "white"
} }
} }

View File

@ -18,24 +18,23 @@ Item {
target: Widget target: Widget
function onQmlExit() { function onQmlExit() {
if (Qt.platform.os === "windows") if (Qt.platform.os === "windows")
Widget.setWindowBlur(0) Widget.setWindowBlur(0);
loader.source = "" loader.source = "";
animFadeOut.start() animFadeOut.start();
} }
function onQmlSceneValueReceived(key, value) { function onQmlSceneValueReceived(key, value) {
var obj2 = 'import QtQuick; Item {Component.onCompleted: loader.item.' var obj2 = 'import QtQuick; Item {Component.onCompleted: loader.item.' + key + ' = ' + value + '; }';
+ key + ' = ' + value + '; }' var newObject = Qt.createQmlObject(obj2.toString(), root, "err");
var newObject = Qt.createQmlObject(obj2.toString(), root, "err") newObject.destroy(10000);
newObject.destroy(10000)
} }
// Replace wallpaper with QML Scene // Replace wallpaper with QML Scene
function onReloadQML(oldType) { function onReloadQML(oldType) {
loader.sourceComponent = undefined loader.sourceComponent = undefined;
loader.source = "" loader.source = "";
Widget.clearComponentCache() Widget.clearComponentCache();
loader.source = Qt.resolvedUrl(Widget.projectSourceFileAbsolute) loader.source = Qt.resolvedUrl(Widget.projectSourceFileAbsolute);
} }
} }
@ -65,11 +64,11 @@ Item {
Component.onCompleted: { Component.onCompleted: {
switch (Widget.type) { switch (Widget.type) {
case InstalledType.QMLWidget: case InstalledType.QMLWidget:
loader.source = Qt.resolvedUrl(Widget.projectSourceFileAbsolute) loader.source = Qt.resolvedUrl(Widget.projectSourceFileAbsolute);
break break;
case InstalledType.HTMLWidget: case InstalledType.HTMLWidget:
loader.sourceComponent = webViewComponent loader.sourceComponent = webViewComponent;
break break;
} }
} }
onStatusChanged: { onStatusChanged: {
@ -77,10 +76,10 @@ Item {
// Resize to loaded widget size // Resize to loaded widget size
// Note: We must use implicit* here to not // Note: We must use implicit* here to not
// break the set values. // break the set values.
root.width = loader.item.implicitWidth root.width = loader.item.implicitWidth;
root.height = loader.item.implicitHeight root.height = loader.item.implicitHeight;
Widget.show() Widget.show();
root.state = "in" root.state = "in";
} }
} }
} }
@ -95,7 +94,7 @@ Item {
anchors.fill: parent anchors.fill: parent
onJavaScriptConsoleMessage: print(lineNumber, message) onJavaScriptConsoleMessage: print(lineNumber, message)
Component.onCompleted: { Component.onCompleted: {
webView.url = Qt.resolvedUrl(Widget.sourcePath) webView.url = Qt.resolvedUrl(Widget.sourcePath);
} }
} }
} }
@ -110,20 +109,19 @@ Item {
onEntered: imgClose.state = "areaHover" onEntered: imgClose.state = "areaHover"
onExited: { onExited: {
if (mouseAreaClose.containsMouse) if (mouseAreaClose.containsMouse)
return return;
imgClose.state = "" imgClose.state = "";
} }
onPressed: function (mouse) { onPressed: function (mouse) {
clickPos = { clickPos = {
"x": mouse.x, "x": mouse.x,
"y": mouse.y "y": mouse.y
} };
} }
onPositionChanged: { onPositionChanged: {
if (mouseArea.pressed) if (mouseArea.pressed)
Widget.setPos(Widget.cursorPos().x - clickPos.x, Widget.setPos(Widget.cursorPos().x - clickPos.x, Widget.cursorPos().y - clickPos.y);
Widget.cursorPos().y - clickPos.y)
} }
} }
@ -137,8 +135,8 @@ Item {
onExited: imgClose.state = "" onExited: imgClose.state = ""
onClicked: { onClicked: {
if (Qt.platform.os === "windows") if (Qt.platform.os === "windows")
Widget.setWindowBlur(0) Widget.setWindowBlur(0);
animFadeOut.start() animFadeOut.start();
} }
anchors { anchors {

View File

@ -7,30 +7,30 @@ Rectangle {
property string backgroundImage: "" property string backgroundImage: ""
property int imageOffsetTop: 0 property int imageOffsetTop: 0
property int stackViewDepth: 0 property int stackViewDepth: 0
onStackViewDepthChanged: { onStackViewDepthChanged: {
if (stackViewDepth > 1) { if (stackViewDepth > 1) {
root.state = "backgroundBlur" root.state = "backgroundBlur";
return true return true;
} }
root.state = "backgroundImage" root.state = "backgroundImage";
return false return false;
} }
color: "#161C1D" color: "#161C1D"
onImageOffsetTopChanged: { onImageOffsetTopChanged: {
if ((imageOffsetTop * -1) >= 200) { if ((imageOffsetTop * -1) >= 200) {
root.state = "backgroundColor" root.state = "backgroundColor";
} else { } else {
if (root.state !== "backgroundImage") if (root.state !== "backgroundImage")
root.state = "backgroundImage" root.state = "backgroundImage";
} }
} }
onBackgroundImageChanged: { onBackgroundImageChanged: {
if (backgroundImage === "") if (backgroundImage === "")
root.state = "" root.state = "";
else else
root.state = "backgroundImage" root.state = "backgroundImage";
} }
Image { Image {

View File

@ -6,7 +6,6 @@ import Qt5Compat.GraphicalEffects
import ScreenPlayApp import ScreenPlayApp
import ScreenPlay import ScreenPlay
Item { Item {
id: root id: root
@ -23,7 +22,7 @@ Item {
} }
RowLayout { RowLayout {
anchors{ anchors {
fill: parent fill: parent
rightMargin: 20 rightMargin: 20
leftMargin: 20 leftMargin: 20
@ -49,5 +48,4 @@ Item {
} }
} }
} }
} }

View File

@ -35,8 +35,7 @@ Rectangle {
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: { text: {
return steam.steamAccount.username + qsTr( return steam.steamAccount.username + qsTr(" Subscribed items: ") + steam.steamAccount.amountSubscribedItems;
" Subscribed items: ") + steam.steamAccount.amountSubscribedItems
} }
anchors { anchors {
@ -55,7 +54,7 @@ Rectangle {
width: 30 width: 30
height: 30 height: 30
Component.onCompleted: { Component.onCompleted: {
steam.steamAccount.loadAvatar() steam.steamAccount.loadAvatar();
} }
anchors { anchors {
@ -66,8 +65,8 @@ Rectangle {
Connections { Connections {
function onAvatarChanged(_avatar) { function onAvatarChanged(_avatar) {
avatar.setImage(_avatar) avatar.setImage(_avatar);
avatarPlaceholder.opacity = 0 avatarPlaceholder.opacity = 0;
} }
target: steam.steamAccount target: steam.steamAccount

View File

@ -54,8 +54,7 @@ Popup {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
color: Material.secondaryTextColor color: Material.secondaryTextColor
text: qsTr("Steam Error Restart: %1\nSteam Error API Init: %2").arg( text: qsTr("Steam Error Restart: %1\nSteam Error API Init: %2").arg(steam.steamErrorRestart).arg(root.steam.steamErrorAPIInit)
steam.steamErrorRestart).arg(root.steam.steamErrorAPIInit)
} }
Button { Button {
@ -63,8 +62,8 @@ Popup {
text: qsTr("Back") text: qsTr("Back")
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
onClicked: { onClicked: {
root.close() root.close();
App.util.setNavigation("Installed") App.util.setNavigation("Installed");
} }
} }
Item { Item {

View File

@ -43,7 +43,6 @@ Item {
y: 0 y: 0
z: 0 z: 0
} }
}, },
Translate { Translate {
id: tr id: tr
@ -105,7 +104,6 @@ Item {
easing.type: Easing.OutQuint easing.type: Easing.OutQuint
properties: "xScale,yScale" properties: "xScale,yScale"
} }
} }
RectangularGlow { RectangularGlow {
@ -124,7 +122,6 @@ Item {
top: parent.top top: parent.top
topMargin: 3 topMargin: 3
} }
} }
Item { Item {
@ -170,7 +167,6 @@ Item {
left: parent.left left: parent.left
margins: 10 margins: 10
} }
} }
Rectangle { Rectangle {
@ -183,9 +179,7 @@ Item {
left: parent.left left: parent.left
bottom: parent.bottom bottom: parent.bottom
} }
} }
} }
OpacityMask { OpacityMask {
@ -201,21 +195,17 @@ Item {
onEntered: { onEntered: {
if (!hasMenuOpen) if (!hasMenuOpen)
screenPlayItem.state = "hover"; screenPlayItem.state = "hover";
} }
onExited: { onExited: {
if (!hasMenuOpen) if (!hasMenuOpen)
screenPlayItem.state = "visible"; screenPlayItem.state = "visible";
} }
onClicked: { onClicked: {
checkBox.toggle(); checkBox.toggle();
if (mouse.button === Qt.LeftButton) if (mouse.button === Qt.LeftButton)
itemClicked(screenId, type, checkBox.checkState === Qt.Checked); itemClicked(screenId, type, checkBox.checkState === Qt.Checked);
} }
} }
} }
CheckBox { CheckBox {
@ -233,9 +223,7 @@ Item {
right: parent.right right: parent.right
margins: 10 margins: 10
} }
} }
} }
states: [ states: [
@ -252,7 +240,6 @@ Item {
target: effect target: effect
opacity: 0 opacity: 0
} }
}, },
State { State {
name: "visible" name: "visible"
@ -278,7 +265,6 @@ Item {
target: icnType target: icnType
opacity: 0 opacity: 0
} }
}, },
State { State {
name: "selected" name: "selected"
@ -293,7 +279,6 @@ Item {
target: icnType target: icnType
opacity: 0.5 opacity: 0.5
} }
} }
] ]
transitions: [ transitions: [
@ -311,7 +296,6 @@ Item {
property: "opacity" property: "opacity"
duration: 80 duration: 80
} }
} }
] ]
} }

View File

@ -34,7 +34,6 @@ Item {
target: image target: image
opacity: 0 opacity: 0
} }
}, },
State { State {
name: "loaded" name: "loaded"
@ -43,7 +42,6 @@ Item {
target: image target: image
opacity: 1 opacity: 1
} }
} }
] ]
transitions: [ transitions: [
@ -57,7 +55,6 @@ Item {
duration: 300 duration: 300
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
} }
} }
] ]
} }

View File

@ -22,22 +22,21 @@ Drawer {
function setWorkshopItem(publishedFileID, imgUrl, videoPreview, subscriptionCount) { function setWorkshopItem(publishedFileID, imgUrl, videoPreview, subscriptionCount) {
if (root.publishedFileID === publishedFileID) { if (root.publishedFileID === publishedFileID) {
if (!root.visible) if (!root.visible)
root.open() root.open();
else else
root.close() root.close();
return return;
} }
root.publishedFileID = publishedFileID root.publishedFileID = publishedFileID;
root.imgUrl = imgUrl root.imgUrl = imgUrl;
root.subscriptionCount = subscriptionCount root.subscriptionCount = subscriptionCount;
root.videoPreview = videoPreview root.videoPreview = videoPreview;
root.subscribed = false root.subscribed = false;
txtVotesUp.highlighted = false txtVotesUp.highlighted = false;
txtVotesDown.highlighted = false txtVotesDown.highlighted = false;
if (!root.visible) if (!root.visible)
root.open() root.open();
steamWorkshop.requestWorkshopItemDetails(publishedFileID);
steamWorkshop.requestWorkshopItemDetails(publishedFileID)
} }
edge: Qt.RightEdge edge: Qt.RightEdge
@ -49,31 +48,30 @@ Drawer {
Connections { Connections {
function onRequestItemDetailReturned(title, tags, steamIDOwner, description, votesUp, votesDown, url, fileSize, publishedFileId) { function onRequestItemDetailReturned(title, tags, steamIDOwner, description, votesUp, votesDown, url, fileSize, publishedFileId) {
tagListModel.clear() tagListModel.clear();
// Even if the tags array is empty it still contains // Even if the tags array is empty it still contains
// one empty string, resulting in an empty button // one empty string, resulting in an empty button
if (tags.length > 1) { if (tags.length > 1) {
for (var i in tags) { for (var i in tags) {
tagListModel.append({ tagListModel.append({
"name": tags[i] "name": tags[i]
}) });
} }
rpTagList.model = tagListModel rpTagList.model = tagListModel;
} else { } else {
rpTagList.model = null rpTagList.model = null;
} }
txtTitle.text = title txtTitle.text = title;
const size = Math.floor((1000 * ((fileSize / 1024) / 1000)) / 1000) const size = Math.floor((1000 * ((fileSize / 1024) / 1000)) / 1000);
txtFileSize.text = qsTr("Size: ") + size + " MB" txtFileSize.text = qsTr("Size: ") + size + " MB";
pbVotes.to = votesDown + votesUp pbVotes.to = votesDown + votesUp;
pbVotes.value = votesUp pbVotes.value = votesUp;
txtVotesDown.text = votesDown txtVotesDown.text = votesDown;
txtVotesUp.text = votesUp txtVotesUp.text = votesUp;
if (description === "") if (description === "")
description = qsTr("No description...") description = qsTr("No description...");
txtDescription.text = description;
txtDescription.text = description pbVotes.hoverText = votesUp + " / " + votesDown;
pbVotes.hoverText = votesUp + " / " + votesDown
} }
target: steamWorkshop target: steamWorkshop
@ -187,9 +185,9 @@ Drawer {
ToolTip.visible: hovered ToolTip.visible: hovered
ToolTip.text: qsTr("Click here if you like the content") ToolTip.text: qsTr("Click here if you like the content")
onClicked: { onClicked: {
steamWorkshop.vote(root.publishedFileID, true) steamWorkshop.vote(root.publishedFileID, true);
txtVotesUp.highlighted = true txtVotesUp.highlighted = true;
txtVotesDown.highlighted = false txtVotesDown.highlighted = false;
} }
} }
@ -201,9 +199,9 @@ Drawer {
ToolTip.visible: hovered ToolTip.visible: hovered
ToolTip.text: qsTr("Click here if you do not like the content") ToolTip.text: qsTr("Click here if you do not like the content")
onClicked: { onClicked: {
steamWorkshop.vote(root.publishedFileID, false) steamWorkshop.vote(root.publishedFileID, false);
txtVotesUp.highlighted = false txtVotesUp.highlighted = false;
txtVotesDown.highlighted = true txtVotesDown.highlighted = true;
} }
} }
} }
@ -230,8 +228,7 @@ Drawer {
ScrollBar.horizontal: ScrollBar { ScrollBar.horizontal: ScrollBar {
height: 5 height: 5
} }
contentWidth: rpTagList.childrenRect.width + rowTagList.width contentWidth: rpTagList.childrenRect.width + rowTagList.width + (rpTagList.count * rowTagList.spacing)
+ (rpTagList.count * rowTagList.spacing)
contentHeight: 40 contentHeight: 40
Row { Row {
@ -259,7 +256,6 @@ Drawer {
} }
} }
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
spacing: 20 spacing: 20
@ -331,8 +327,7 @@ Drawer {
icon.source: "qrc:/qml/ScreenPlayWorkshop/assets/icons/icon_open_in_new.svg" icon.source: "qrc:/qml/ScreenPlayWorkshop/assets/icons/icon_open_in_new.svg"
height: 25 height: 25
text: qsTr("Open In Steam") text: qsTr("Open In Steam")
onClicked: Qt.openUrlExternally( onClicked: Qt.openUrlExternally("steam://url/CommunityFilePage/" + root.publishedFileID)
"steam://url/CommunityFilePage/" + root.publishedFileID)
} }
Button { Button {
@ -343,15 +338,14 @@ Drawer {
icon.source: "qrc:/qml/ScreenPlayWorkshop/assets/icons/icon_download.svg" icon.source: "qrc:/qml/ScreenPlayWorkshop/assets/icons/icon_download.svg"
text: root.subscribed ? qsTr("Subscribed!") : qsTr("Subscribe") text: root.subscribed ? qsTr("Subscribed!") : qsTr("Subscribe")
onClicked: { onClicked: {
root.subscribed = true root.subscribed = true;
root.steamWorkshop.subscribeItem(root.publishedFileID) root.steamWorkshop.subscribeItem(root.publishedFileID);
} }
} }
} }
background: Rectangle { background: Rectangle {
color: Material.theme === Material.Light ? "white" : Qt.darker( color: Material.theme === Material.Light ? "white" : Qt.darker(Material.background)
Material.background)
opacity: 0.95 opacity: 0.95
} }

View File

@ -45,13 +45,13 @@ Item {
width: 70 width: 70
height: 70 height: 70
Component.onCompleted: { Component.onCompleted: {
root.steamWorkshop.steamAccount.loadAvatar() root.steamWorkshop.steamAccount.loadAvatar();
} }
Connections { Connections {
function onAvatarChanged(_avatar) { function onAvatarChanged(_avatar) {
avatar.setImage(_avatar) avatar.setImage(_avatar);
avatarPlaceholder.opacity = 0 avatarPlaceholder.opacity = 0;
} }
target: root.steamWorkshop.steamAccount target: root.steamWorkshop.steamAccount
@ -133,8 +133,7 @@ Item {
text: qsTr("Back") text: qsTr("Back")
enabled: root.steamWorkshop.workshopProfileListModel.currentPage > 1 enabled: root.steamWorkshop.workshopProfileListModel.currentPage > 1
onClicked: { onClicked: {
root.steamWorkshop.workshopProfileListModel.setCurrentPage( root.steamWorkshop.workshopProfileListModel.setCurrentPage(root.steamWorkshop.workshopProfileListModel.currentPage - 1);
root.steamWorkshop.workshopProfileListModel.currentPage - 1)
} }
} }
@ -142,8 +141,7 @@ Item {
id: txtPage id: txtPage
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
text: root.steamWorkshop.workshopProfileListModel.currentPage text: root.steamWorkshop.workshopProfileListModel.currentPage + "/" + root.steamWorkshop.workshopProfileListModel.pages
+ "/" + root.steamWorkshop.workshopProfileListModel.pages
color: Material.primaryTextColor color: Material.primaryTextColor
} }
@ -152,11 +150,9 @@ Item {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
text: qsTr("Forward") text: qsTr("Forward")
enabled: root.steamWorkshop.workshopProfileListModel.currentPage enabled: root.steamWorkshop.workshopProfileListModel.currentPage <= root.steamWorkshop.workshopProfileListModel.pages - 1
<= root.steamWorkshop.workshopProfileListModel.pages - 1
onClicked: { onClicked: {
root.steamWorkshop.workshopProfileListModel.setCurrentPage( root.steamWorkshop.workshopProfileListModel.setCurrentPage(root.steamWorkshop.workshopProfileListModel.currentPage + 1);
root.steamWorkshop.workshopProfileListModel.currentPage + 1)
} }
} }

View File

@ -17,26 +17,23 @@ Item {
Component.onCompleted: { Component.onCompleted: {
if (screenPlayWorkshop.init()) { if (screenPlayWorkshop.init()) {
stackView.push("qrc:/qml/ScreenPlayWorkshop/qml/SteamWorkshopStartPage.qml", { stackView.push("qrc:/qml/ScreenPlayWorkshop/qml/SteamWorkshopStartPage.qml", {
"stackView": stackView, "stackView": stackView,
"screenPlayWorkshop": screenPlayWorkshop, "screenPlayWorkshop": screenPlayWorkshop,
"steamWorkshop": screenPlayWorkshop.steamWorkshop, "steamWorkshop": screenPlayWorkshop.steamWorkshop,
"background": background, "background": background
// "modalSource": root.modalSource });
})
} else { } else {
popupOffline.open() popupOffline.open();
} }
} }
} }
Background { Background {
id: background id: background
anchors.fill: parent anchors.fill: parent
stackViewDepth: stackView.depth stackViewDepth: stackView.depth
} }
PopupOffline { PopupOffline {
id: popupOffline id: popupOffline
workshop: screenPlayWorkshop workshop: screenPlayWorkshop
@ -52,7 +49,7 @@ Item {
target: stackView.currentItem target: stackView.currentItem
ignoreUnknownSignals: true ignoreUnknownSignals: true
function onRequestBack() { function onRequestBack() {
stackView.pop() stackView.pop();
} }
} }

Some files were not shown because too many files have changed in this diff Show More