1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-18 08:22:33 +02:00

Fix InstalledDrawer setWallpaperAtTimelineIndex incorrect index

Formatting
This commit is contained in:
Elias Steurer 2024-05-25 15:36:24 +02:00
parent d88859927d
commit 59ce122225
63 changed files with 634 additions and 813 deletions

View File

@ -3,7 +3,6 @@ import QtQuick.Controls
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
TabButton { TabButton {
id: control id: control
@ -66,6 +65,5 @@ TabButton {
} }
} }
background: Item { background: Item {}
}
} }

View File

@ -5,7 +5,6 @@ import Qt5Compat.GraphicalEffects
import QtQuick.Layouts import QtQuick.Layouts
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: root id: root

View File

@ -6,7 +6,6 @@ import QtQuick.Layouts
import QtQml.XmlListModel import QtQml.XmlListModel
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: root id: root

View File

@ -25,7 +25,6 @@ Item {
return hours.toString().padStart(2, '0') + ":" + minutes.toString().padStart(2, '0'); return hours.toString().padStart(2, '0') + ":" + minutes.toString().padStart(2, '0');
} }
property real lineMinimum: .5 property real lineMinimum: .5
property real lineMaximum: .5 property real lineMaximum: .5
property bool isLast: false property bool isLast: false
@ -54,7 +53,7 @@ Item {
text: root.timeString text: root.timeString
color: "white" color: "white"
visible: !root.isLast visible: !root.isLast
anchors{ anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
bottom: parent.bottom bottom: parent.bottom
bottomMargin: -20 bottomMargin: -20
@ -71,8 +70,8 @@ Item {
minimum: root.lineMinimum minimum: root.lineMinimum
maximum: root.lineMaximum maximum: root.lineMaximum
onActiveValueChanged: delta => { onActiveValueChanged: delta => {
root.handleMoved(root) root.handleMoved(root);
} }
} }
} }
} }

View File

@ -16,7 +16,7 @@ Rectangle {
id: text id: text
color: "white" color: "white"
//text: root.index //text: root.index
anchors{ anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
bottom: parent.bottom bottom: parent.bottom
bottomMargin: 10 bottomMargin: 10
@ -27,15 +27,14 @@ Rectangle {
color: "gold" color: "gold"
anchors.fill: parent anchors.fill: parent
visible: root.selected visible: root.selected
} }
Rectangle { Rectangle {
id: indicatorLineVertical id: indicatorLineVertical
width: 5 width: 5
height: 30 height: 30
color: root.selected ? "gold" : parent.color color: root.selected ? "gold" : parent.color
anchors{ anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
top: parent.bottom top: parent.bottom
topMargin: 0 topMargin: 0
@ -50,7 +49,7 @@ Rectangle {
border.width: root.selected ? 2 : 0 border.width: root.selected ? 2 : 0
border.color: "gold" border.color: "gold"
color: parent.color color: parent.color
anchors{ anchors {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
top: indicatorLineVertical.bottom top: indicatorLineVertical.bottom
topMargin: -1 topMargin: -1
@ -58,27 +57,26 @@ Rectangle {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onClicked:{ onClicked: {
root.lineSelected(root.index) root.lineSelected(root.index);
} }
} }
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: root.index + " - "+ root.identifier text: root.index + " - " + root.identifier
} }
} }
ToolButton { ToolButton {
text:"❌" text: "❌"
visible: !root.isLast visible: !root.isLast
enabled: visible enabled: visible
onClicked: root.remove(root.index) onClicked: root.remove(root.index)
font.pointSize: 10 font.pointSize: 10
anchors {
anchors{
left: background.right left: background.right
bottom: background.top bottom: background.top
margins: - 20 margins: -20
} }
} }
} }

View File

@ -83,7 +83,7 @@ Dialog {
id: txtHeadline id: txtHeadline
y: 80 y: 80
text: qsTr("✅ 3D Wallpaper\n✅ Wallpaper Timeline") text: qsTr("✅ 3D Wallpaper\n✅ Wallpaper Timeline")
font.family: App.settings.font font.family: App.settings.font
font.capitalization: Font.Capitalize font.capitalization: Font.Capitalize
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
@ -122,14 +122,14 @@ Dialog {
font.pointSize: 16 font.pointSize: 16
width: implicitWidth + 20 width: implicitWidth + 20
height: implicitHeight + 10 height: implicitHeight + 10
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_community.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_community.svg"
icon.width: 18 icon.width: 18
icon.height: 18 icon.height: 18
onClicked: { onClicked: {
if (App.globalVariables.isSteamVersion()) { if (App.globalVariables.isSteamVersion()) {
Qt.openUrlExternally("https://forum.screen-play.app/") Qt.openUrlExternally("https://forum.screen-play.app/");
} else { } else {
Qt.openUrlExternally("https://forum.screen-play.app/") Qt.openUrlExternally("https://forum.screen-play.app/");
} }
} }
@ -306,7 +306,6 @@ Dialog {
duration: 1500 duration: 1500
easing.type: Easing.OutBack easing.type: Easing.OutBack
} }
} }
} }
] ]

View File

@ -5,7 +5,6 @@ import QtQuick.Layouts
import ScreenPlayApp import ScreenPlayApp
import ScreenPlayUtil import ScreenPlayUtil
Control { Control {
id: root id: root
height: 160 height: 160
@ -16,24 +15,19 @@ Control {
property int activeTimelineIndex: 0 property int activeTimelineIndex: 0
function getActiveTimeline(){ function getActiveTimeline() {
return timeLine.sectionsList[root.activeTimelineIndex] return timeLine.sectionsList[root.activeTimelineIndex];
} }
function removeAll(){ function removeAll() {
timeLine.removeAll() timeLine.removeAll();
} }
function printTimelines(){ function printTimelines() {
print("################# qml:") print("################# qml:");
for (let i = 0; i < timeLine.sectionsList.length; i++) { for (let i = 0; i < timeLine.sectionsList.length; i++) {
print( print(timeLine.sectionsList[i].index, timeLine.sectionsList[i].identifier, timeLine.sectionsList[i].relativeLinePosition);
timeLine.sectionsList[i].index,
timeLine.sectionsList[i].identifier,
timeLine.sectionsList[i].relativeLinePosition)
} }
} }
Component { Component {
@ -41,7 +35,7 @@ Control {
QtObject { QtObject {
property string identifier property string identifier
property int index: 0 property int index: 0
property real relativeLinePosition: lineHandle.linePosition property real relativeLinePosition: lineHandle.linePosition
//onRelativeLinePositionChanged: print("relativelinepos: ", relativeLinePosition) //onRelativeLinePositionChanged: print("relativelinepos: ", relativeLinePosition)
property LineHandle lineHandle property LineHandle lineHandle
property LineIndicator lineIndicator property LineIndicator lineIndicator
@ -52,12 +46,12 @@ Control {
id: timeLine id: timeLine
property var sectionsList: [] property var sectionsList: []
property var lineColors: [ "#FFB300", "#FB8C00", "#F4511E","#E53935", "#D81B60", "#8E24AA", "#5E35B1", "#3949AB", "#1E88E5", "#00897B", "#43A047", "#C0CA33"] property var lineColors: ["#FFB300", "#FB8C00", "#F4511E", "#E53935", "#D81B60", "#8E24AA", "#5E35B1", "#3949AB", "#1E88E5", "#00897B", "#43A047", "#C0CA33"]
onWidthChanged: timeLine.updatePositions() onWidthChanged: timeLine.updatePositions()
Component.onCompleted: { Component.onCompleted: {
const initialStopPositions = App.screenPlayManager.initialStopPositions() const initialStopPositions = App.screenPlayManager.initialStopPositions();
createAllSections(initialStopPositions) createAllSections(initialStopPositions);
} }
function createAllSections(initialStopPositions) { function createAllSections(initialStopPositions) {
@ -67,253 +61,229 @@ Control {
} }
} }
function removeAll(){ function removeAll() {
print("removeAll",timeLine.sectionsList.length) print("removeAll", timeLine.sectionsList.length);
for (let i = 0; i < timeLine.sectionsList.length; i++) { for (let i = 0; i < timeLine.sectionsList.length; i++) {
// ORDER is important here! Destory the children first // ORDER is important here! Destory the children first
print("remove index ", i) print("remove index ", i);
let section = timeLine.sectionsList[i] let section = timeLine.sectionsList[i];
section.lineHandle.destroy() section.lineHandle.destroy();
section.lineIndicator.destroy() section.lineIndicator.destroy();
section.destroy() section.destroy();
} }
timeLine.sectionsList = [] timeLine.sectionsList = [];
App.screenPlayManager.removeAllTimlineSections();
App.screenPlayManager.removeAllTimlineSections() const position = 1.0;
const position = 1.0
const identifier = App.util.generateRandomString(4); const identifier = App.util.generateRandomString(4);
const sectionObject = timeLine.addSection(identifier,position) const sectionObject = timeLine.addSection(identifier, position);
App.screenPlayManager.addTimelineAt( App.screenPlayManager.addTimelineAt(sectionObject.index, sectionObject.relativeLinePosition, sectionObject.identifier);
sectionObject.index,
sectionObject.relativeLinePosition,
sectionObject.identifier)
} }
// IMPORTANT: The new element is always on the left. The first // IMPORTANT: The new element is always on the left. The first
// handle always persists because the // handle always persists because the
// user can never delete it. It only gets "pushed" further // user can never delete it. It only gets "pushed" further
// to the right, by increasing the size. // to the right, by increasing the size.
function addSection(identifier, stopPosition) { function addSection(identifier, stopPosition) {
print("stopPosition", stopPosition) print("stopPosition", stopPosition);
// Make sure to limit float precision // Make sure to limit float precision
const fixedStopPosition = stopPosition const fixedStopPosition = stopPosition;
print("addSection at: ", fixedStopPosition) print("addSection at: ", fixedStopPosition);
if (stopPosition < 0 || fixedStopPosition > 1) { if (stopPosition < 0 || fixedStopPosition > 1) {
console.error("Invalid position:", fixedStopPosition) console.error("Invalid position:", fixedStopPosition);
return return;
} }
let sectionObject = sectionComp.createObject(timeLine, { let sectionObject = sectionComp.createObject(timeLine, {
"identifier" : identifier, "identifier": identifier,
"relativeLinePosition": fixedStopPosition "relativeLinePosition": fixedStopPosition
}) });
timeLine.sectionsList.push(sectionObject) timeLine.sectionsList.push(sectionObject);
timeLine.sectionsList.sort(function (a, b) { timeLine.sectionsList.sort(function (a, b) {
return a.relativeLinePosition - b.relativeLinePosition return a.relativeLinePosition - b.relativeLinePosition;
}) });
const index = timeLine.sectionsList.indexOf(sectionObject) const index = timeLine.sectionsList.indexOf(sectionObject);
console.log("Addsection:", index) console.log("Addsection:", index);
createSection(index, fixedStopPosition, sectionObject,identifier) createSection(index, fixedStopPosition, sectionObject, identifier);
updatePositions();
updatePositions() return sectionObject;
return sectionObject
} }
function createSection(index, stopPosition, section,identifier) { function createSection(index, stopPosition, section, identifier) {
console.log("Adding at:", index, stopPosition, identifier) console.log("Adding at:", index, stopPosition, identifier);
//console.assert(isFloat(stopPosition)) //console.assert(isFloat(stopPosition))
let haComponent = Qt.createComponent("LineHandle.qml") let haComponent = Qt.createComponent("LineHandle.qml");
if (haComponent.status === Component.Error) { if (haComponent.status === Component.Error) {
console.assert(haComponent.errorString()) console.assert(haComponent.errorString());
return return;
} }
section.lineHandle = haComponent.createObject(handleWrapper);
section.lineHandle = haComponent.createObject(handleWrapper) section.lineHandle.lineWidth = timeLine.width;
section.lineHandle.lineWidth = timeLine.width section.lineHandle.x = Math.round(handleWrapper.width * timeLine.sectionsList[index].relativeLinePosition);
section.lineHandle.x = Math.round( section.lineHandle.y = -section.lineHandle.height / 2;
handleWrapper.width * timeLine.sectionsList[index].relativeLinePosition)
section.lineHandle.y = -section.lineHandle.height / 2
// Will be set later // Will be set later
section.lineHandle.lineMinimum = timeLine.x section.lineHandle.lineMinimum = timeLine.x;
section.lineHandle.lineMaximum = timeLine.x section.lineHandle.lineMaximum = timeLine.x;
section.lineHandle.handleMoved.connect(timeLine.onHandleMoved) section.lineHandle.handleMoved.connect(timeLine.onHandleMoved);
let liComponent = Qt.createComponent("LineIndicator.qml");
let liComponent = Qt.createComponent("LineIndicator.qml")
if (liComponent.status === Component.Error) { if (liComponent.status === Component.Error) {
console.assert(liComponent.errorString()) console.assert(liComponent.errorString());
return return;
} }
// Set color initially so we do not have a weird color animation at start // Set color initially so we do not have a weird color animation at start
const lineIndicatorProperties = { const lineIndicatorProperties = {
"color": getColorAtIndex(index) "color": getColorAtIndex(index)
} };
section.lineIndicator = liComponent.createObject( section.lineIndicator = liComponent.createObject(lineIndicatorWrapper, lineIndicatorProperties);
lineIndicatorWrapper, lineIndicatorProperties) section.lineIndicator.height = lineIndicatorWrapper.height;
section.lineIndicator.height = lineIndicatorWrapper.height section.lineIndicator.index = index;
section.lineIndicator.index = index section.lineIndicator.identifier = identifier;
section.lineIndicator.identifier = identifier section.lineIndicator.color = getColorAtIndex(index);
section.lineIndicator.color = getColorAtIndex(index) section.lineIndicator.remove.connect(timeLine.removeSection);
section.lineIndicator.remove.connect(timeLine.removeSection) section.lineIndicator.lineSelected.connect(timeLine.lineIndicatorSelected);
section.lineIndicator.lineSelected.connect(
timeLine.lineIndicatorSelected)
} }
function sectionFromHandle(lineHandle){ function sectionFromHandle(lineHandle) {
for (let i = 0; i < timeLine.sectionsList.length; i++) { for (let i = 0; i < timeLine.sectionsList.length; i++) {
if(timeLine.sectionsList[i].lineHandle === lineHandle) if (timeLine.sectionsList[i].lineHandle === lineHandle)
return timeLine.sectionsList[i] return timeLine.sectionsList[i];
} }
return null return null;
} }
function onHandleMoved(lineHandle){ function onHandleMoved(lineHandle) {
updatePositions() updatePositions();
const section = sectionFromHandle(lineHandle);
const section = sectionFromHandle(lineHandle) if (section === null) {
if (section === null){ print(lineHandle.linePosition);
print(lineHandle.linePosition) console.error("Unable to match handle to section list");
console.error("Unable to match handle to section list") return;
return
} }
App.screenPlayManager.moveTimelineAt(section.index, section.identifier, lineHandle.linePosition, lineHandle.timeString);
App.screenPlayManager.moveTimelineAt(section.index, section.identifier, lineHandle.linePosition, lineHandle.timeString)
} }
function lineIndicatorSelected(activeTimelineIndex) { function lineIndicatorSelected(activeTimelineIndex) {
for (let i = 0; i < timeLine.sectionsList.length; i++) { for (let i = 0; i < timeLine.sectionsList.length; i++) {
if (i === activeTimelineIndex) { if (i === activeTimelineIndex) {
timeLine.sectionsList[i].lineIndicator.selected = true timeLine.sectionsList[i].lineIndicator.selected = true;
continue continue;
} }
timeLine.sectionsList[i].lineIndicator.selected = false timeLine.sectionsList[i].lineIndicator.selected = false;
} }
root.activeTimelineIndex = activeTimelineIndex root.activeTimelineIndex = activeTimelineIndex;
} }
// We must update all indexes when removing/adding an element // We must update all indexes when removing/adding an element
function updateIndicatorIndexes() { function updateIndicatorIndexes() {
if(timeLine.sectionsList === null || timeLine.sectionsList === undefined) if (timeLine.sectionsList === null || timeLine.sectionsList === undefined)
return return;
timeLine.sectionsList.sort(function (a, b) { timeLine.sectionsList.sort(function (a, b) {
return a.relativeLinePosition - b.relativeLinePosition return a.relativeLinePosition - b.relativeLinePosition;
}) });
for (let i = 0; i < timeLine.sectionsList.length; i++) { for (let i = 0; i < timeLine.sectionsList.length; i++) {
timeLine.sectionsList[i].index = i timeLine.sectionsList[i].index = i;
timeLine.sectionsList[i].lineIndicator.index = i timeLine.sectionsList[i].lineIndicator.index = i;
//print("updateIndicatorIndexes:", timeLine.sectionsList[i].index, timeLine.sectionsList[i].relativeLinePosition) //print("updateIndicatorIndexes:", timeLine.sectionsList[i].index, timeLine.sectionsList[i].relativeLinePosition)
} }
} }
function removeSection(index) { function removeSection(index) {
print(timeLine.stopPositionList) print(timeLine.stopPositionList);
print(timeLine.sectionList) print(timeLine.sectionList);
const isLast = index === timeLine.sectionsList.length - 1;
const isLast = index === timeLine.sectionsList.length - 1
if (isLast) if (isLast)
return return;
// ORDER is important here! First destory the object // ORDER is important here! First destory the object
// and then remove i f // and then remove i f
let section = timeLine.sectionsList[index] let section = timeLine.sectionsList[index];
section.lineHandle.destroy() section.lineHandle.destroy();
section.lineIndicator.destroy() section.lineIndicator.destroy();
section.destroy() section.destroy();
timeLine.sectionsList.splice(index, 1) timeLine.sectionsList.splice(index, 1);
updatePositions();
updatePositions() App.screenPlayManager.removeTimelineAt(index);
App.screenPlayManager.removeTimelineAt(index)
} }
function updatePositions() { function updatePositions() {
// Iterate through each handle in the 'sectionList' array // Iterate through each handle in the 'sectionList' array
for (let i = 0; i < timeLine.sectionsList.length; i++) { for (let i = 0; i < timeLine.sectionsList.length; i++) {
let handle = timeLine.sectionsList[i].lineHandle let handle = timeLine.sectionsList[i].lineHandle;
// Determine the minimum position for the current handle // Determine the minimum position for the current handle
let prevPos let prevPos;
if (i === 0) { if (i === 0) {
// If it's the first handle, its minimum is 0 // If it's the first handle, its minimum is 0
prevPos = 0 prevPos = 0;
} else { } else {
// Otherwise, it's directly the position of the previous handle // Otherwise, it's directly the position of the previous handle
prevPos = timeLine.sectionsList[i - 1].lineHandle.x prevPos = timeLine.sectionsList[i - 1].lineHandle.x;
} }
// Determine the maximum position for the current handle // Determine the maximum position for the current handle
let nextPos let nextPos;
if (i === timeLine.sectionsList.length - 1) { if (i === timeLine.sectionsList.length - 1) {
// If it's the last handle, its maximum is the width of the line // If it's the last handle, its maximum is the width of the line
nextPos = timeLine.width nextPos = timeLine.width;
} else { } else {
// Otherwise, it's directly the position of the next handle // Otherwise, it's directly the position of the next handle
nextPos = timeLine.sectionsList[i + 1].lineHandle.x nextPos = timeLine.sectionsList[i + 1].lineHandle.x;
} }
// Set the determined minimum and maximum positions for the current handle // Set the determined minimum and maximum positions for the current handle
handle.lineMinimum = prevPos handle.lineMinimum = prevPos;
handle.lineMaximum = nextPos handle.lineMaximum = nextPos;
//timeLine.sectionsList[i].relativeLinePosition =prevPos / timeLine.width //timeLine.sectionsList[i].relativeLinePosition =prevPos / timeLine.width
// print("sections: ", i, "prev minimum ",prevPos,"next maximum", nextPos, timeLine.sectionsList[i].relativeLinePosition) // print("sections: ", i, "prev minimum ",prevPos,"next maximum", nextPos, timeLine.sectionsList[i].relativeLinePosition)
} }
for (let i = 0; i < timeLine.sectionsList.length; i++) { for (let i = 0; i < timeLine.sectionsList.length; i++) {
let section = timeLine.sectionsList[i] let section = timeLine.sectionsList[i];
section.relativeLinePosition = section.lineHandle.linePosition section.relativeLinePosition = section.lineHandle.linePosition;
// print(section.relativeLinePosition, section.lineHandle.lineMinimum, section.lineHandle.lineMaximum) // print(section.relativeLinePosition, section.lineHandle.lineMinimum, section.lineHandle.lineMaximum)
} }
updateIndicatorPositions() updateIndicatorPositions();
updateLastHandle() updateLastHandle();
updateIndicatorColor() updateIndicatorColor();
updateIndicatorIndexes() updateIndicatorIndexes();
} }
function getColorAtIndex(index) { function getColorAtIndex(index) {
let i = index let i = index;
// Start from the beginnging again // Start from the beginnging again
if (index >= timeLine.lineColors.length) { if (index >= timeLine.lineColors.length) {
i = index % timeLine.lineColors.length i = index % timeLine.lineColors.length;
} }
return timeLine.lineColors[i] return timeLine.lineColors[i];
} }
function updateIndicatorColor() { function updateIndicatorColor() {
for (let i = 0; i < timeLine.sectionsList.length; i++) { for (let i = 0; i < timeLine.sectionsList.length; i++) {
let lineIndicator = timeLine.sectionsList[i].lineIndicator let lineIndicator = timeLine.sectionsList[i].lineIndicator;
lineIndicator.color = getColorAtIndex(i) lineIndicator.color = getColorAtIndex(i);
} }
} }
function updateLastHandle() { function updateLastHandle() {
for (let i = 0; i < timeLine.sectionsList.length; i++) { for (let i = 0; i < timeLine.sectionsList.length; i++) {
timeLine.sectionsList[i].lineHandle.isLast = i === timeLine.sectionsList.length - 1 timeLine.sectionsList[i].lineHandle.isLast = i === timeLine.sectionsList.length - 1;
timeLine.sectionsList[i].lineIndicator.isLast = i timeLine.sectionsList[i].lineIndicator.isLast = i === timeLine.sectionsList.length - 1;
=== timeLine.sectionsList.length - 1
} }
} }
function updateIndicatorPositions() { function updateIndicatorPositions() {
for (let i = 0; i < timeLine.sectionsList.length; i++) { for (let i = 0; i < timeLine.sectionsList.length; i++) {
const lineIndicator = timeLine.sectionsList[i].lineIndicator const lineIndicator = timeLine.sectionsList[i].lineIndicator;
//print(i, lineIndicator.x, lineIndicator.width, timeLine.sectionsList[i].relativeLinePosition) //print(i, lineIndicator.x, lineIndicator.width, timeLine.sectionsList[i].relativeLinePosition)
const handle = timeLine.sectionsList[i].lineHandle const handle = timeLine.sectionsList[i].lineHandle;
lineIndicator.x = handle.dragHandler.xAxis.minimum lineIndicator.x = handle.dragHandler.xAxis.minimum;
lineIndicator.width = (handle.linePosition * handle.lineWidth).toFixed( lineIndicator.width = (handle.linePosition * handle.lineWidth).toFixed(2) - lineIndicator.x;
2) - lineIndicator.x
} }
} }
// https://stackoverflow.com/a/3885844 // https://stackoverflow.com/a/3885844
function isFloat(n) { function isFloat(n) {
return n === +n && n !== (n | 0) return n === +n && n !== (n | 0);
} }
Rectangle { Rectangle {
@ -330,7 +300,6 @@ Control {
enabled: true enabled: true
} }
// Current time indicator // Current time indicator
Rectangle { Rectangle {
id: currentTimeIndicator id: currentTimeIndicator
@ -367,7 +336,6 @@ Control {
} }
} }
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
Repeater { Repeater {
@ -400,14 +368,11 @@ Control {
ToolButton { ToolButton {
text: "" text: ""
onClicked: { onClicked: {
const p = this.x / timeLine.width const p = this.x / timeLine.width;
const position = p.toFixed(4) const position = p.toFixed(4);
const identifier = App.util.generateRandomString(4); const identifier = App.util.generateRandomString(4);
const sectionObject = timeLine.addSection(identifier,position) const sectionObject = timeLine.addSection(identifier, position);
App.screenPlayManager.addTimelineAt( App.screenPlayManager.addTimelineAt(sectionObject.index, sectionObject.relativeLinePosition, sectionObject.identifier);
sectionObject.index,
sectionObject.relativeLinePosition,
sectionObject.identifier)
} }
x: hoverHandler.point.position.x - width * .5 x: hoverHandler.point.position.x - width * .5

View File

@ -3,7 +3,6 @@ import QtQuick.Window
import Qt.labs.platform import Qt.labs.platform
import ScreenPlayApp import ScreenPlayApp
SystemTrayIcon { SystemTrayIcon {
id: root id: root

View File

@ -36,13 +36,13 @@ 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;
App.util.setNavigation("Installed") App.util.setNavigation("Installed");
App.util.setNavigationActive(true) App.util.setNavigationActive(true);
} }
ignoreUnknownSignals: true ignoreUnknownSignals: true
@ -145,15 +145,14 @@ Rectangle {
text: headline text: headline
onClicked: { onClicked: {
if (proFeature && App.globalVariables.isBasicVersion()) if (proFeature && App.globalVariables.isBasicVersion())
return screenPlayProView.open() return screenPlayProView.open();
listView.currentIndex = index;
listView.currentIndex = index const item = stackView.push(source);
const item = stackView.push(source) loaderConnections.target = item;
loaderConnections.target = item
} }
ToolButton { ToolButton {
enabled: false enabled: false
visible: proFeature && App.globalVariables.isBasicVersion() visible: proFeature && App.globalVariables.isBasicVersion()
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/font-awsome/lock-solid.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/font-awsome/lock-solid.svg"
icon.width: 10 icon.width: 10
icon.height: 10 icon.height: 10

View File

@ -15,13 +15,9 @@ WizardPage {
property bool ready: tfTitle.text.length >= 1 && root.file.length !== "" property bool ready: tfTitle.text.length >= 1 && root.file.length !== ""
function create() { function create() {
App.wizards.createGifWallpaper(tfTitle.text, cbLicense.name, App.wizards.createGifWallpaper(tfTitle.text, cbLicense.name, cbLicense.licenseFile, tfCreatedBy.text, root.file, tagSelector.getTags()).then(result => {
cbLicense.licenseFile, wizardFinished(result.success, result.message);
tfCreatedBy.text, root.file, });
tagSelector.getTags()).then(
result => {
wizardFinished(result.success, result.message)
})
} }
onReadyChanged: root.ready = ready onReadyChanged: root.ready = ready
@ -60,18 +56,15 @@ WizardPage {
anchors.fill: parent anchors.fill: parent
onDropped: { onDropped: {
root.file = drop.urls[0] root.file = drop.urls[0];
leftWrapper.color = Qt.darker( leftWrapper.color = Qt.darker(Qt.darker(Material.backgroundColor));
Qt.darker(Material.backgroundColor))
} }
onExited: { onExited: {
leftWrapper.color = Qt.darker( leftWrapper.color = Qt.darker(Material.backgroundColor);
Material.backgroundColor)
} }
onEntered: { onEntered: {
leftWrapper.color = Qt.darker( leftWrapper.color = Qt.darker(Qt.darker(Material.backgroundColor));
Qt.darker(Material.backgroundColor)) drag.accept(Qt.LinkAction);
drag.accept(Qt.LinkAction)
} }
} }
@ -142,34 +135,34 @@ WizardPage {
required: true required: true
} }
Util.TextField { Util.TextField {
id: tfCreatedBy id: tfCreatedBy
Layout.fillWidth: true Layout.fillWidth: true
placeholderText: qsTr("Created By") placeholderText: qsTr("Created By")
} }
Util.LicenseSelector { Util.LicenseSelector {
id: cbLicense id: cbLicense
Layout.fillWidth: true Layout.fillWidth: true
} }
Util.HeadlineSection { Util.HeadlineSection {
text: qsTr("Tags") text: qsTr("Tags")
} }
Util.TagSelector { Util.TagSelector {
id: tagSelector id: tagSelector
Layout.fillWidth: true Layout.fillWidth: true
} }
Item { Item {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
}
} }
} }
} }
} }
}

View File

@ -14,14 +14,9 @@ WizardPage {
id: rightWrapper id: rightWrapper
function create() { function create() {
App.wizards.createGodotWallpaper(tfTitle.text, cbLicense.name, App.wizards.createGodotWallpaper(tfTitle.text, cbLicense.name, cbLicense.licenseFile, tfCreatedBy.text, previewSelector.imageSource, tagSelector.getTags()).then(result => {
cbLicense.licenseFile, wizardFinished(result.success, result.message);
tfCreatedBy.text, });
previewSelector.imageSource,
tagSelector.getTags()).then(
result => {
wizardFinished(result.success, result.message)
})
} }
spacing: 10 spacing: 10

View File

@ -14,14 +14,9 @@ WizardPage {
id: rightWrapper id: rightWrapper
function create() { function create() {
App.wizards.createHTMLWallpaper(tfTitle.text, cbLicense.name, App.wizards.createHTMLWallpaper(tfTitle.text, cbLicense.name, cbLicense.licenseFile, tfCreatedBy.text, previewSelector.imageSource, tagSelector.getTags()).then(result => {
cbLicense.licenseFile, wizardFinished(result.success, result.message);
tfCreatedBy.text, });
previewSelector.imageSource,
tagSelector.getTags()).then(
result => {
wizardFinished(result.success, result.message)
})
} }
spacing: 10 spacing: 10

View File

@ -11,15 +11,9 @@ WizardPage {
sourceComponent: ColumnLayout { sourceComponent: ColumnLayout {
function create() { function create() {
App.wizards.createHTMLWidget(tfTitle.text, cbLicense.name, App.wizards.createHTMLWidget(tfTitle.text, cbLicense.name, cbLicense.licenseFile, tfCreatedBy.text, previewSelector.imageSource, tagSelector.getTags()).then(result => {
cbLicense.licenseFile, wizardFinished(result.success, result.message);
tfCreatedBy.text, });
previewSelector.imageSource,
tagSelector.getTags()).then(result => {
wizardFinished(
result.success,
result.message)
})
} }
Util.Headline { Util.Headline {

View File

@ -5,7 +5,6 @@ import QtQuick.Controls.Material
import QtQuick.Layouts import QtQuick.Layouts
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: root id: root
@ -21,18 +20,18 @@ Item {
clip: true clip: true
CreateWallpaperFileSelect { CreateWallpaperFileSelect {
onNext: function (filePath) { onNext: function (filePath) {
createWallpaperVideoImportConvert.filePath = filePath createWallpaperVideoImportConvert.filePath = filePath;
swipeView.currentIndex = 1 swipeView.currentIndex = 1;
} }
} }
CreateWallpaperSettings { CreateWallpaperSettings {
id: createWallpaperSettings id: createWallpaperSettings
onNext: function (codec,quality) { onNext: function (codec, quality) {
root.wizardStarted() root.wizardStarted();
swipeView.currentIndex = 2 swipeView.currentIndex = 2;
createWallpaperVideoImportConvert.codec = codec createWallpaperVideoImportConvert.codec = codec;
App.create.createWallpaperStart(createWallpaperVideoImportConvert.filePath, codec, quality) App.create.createWallpaperStart(createWallpaperVideoImportConvert.filePath, codec, quality);
} }
} }

View File

@ -49,31 +49,28 @@ 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: drag => { onEntered: drag => {
bg.color = Qt.darker( bg.color = Qt.darker(Qt.darker(Material.backgroundColor));
Qt.darker(Material.backgroundColor)) drag.accept(Qt.LinkAction);
drag.accept(Qt.LinkAction) }
}
onDropped: drop => { onDropped: drop => {
let file = App.util.toLocal(drop.urls[0]) let file = App.util.toLocal(drop.urls[0]);
bg.color = Qt.darker( bg.color = Qt.darker(Qt.darker(Material.backgroundColor));
Qt.darker(Material.backgroundColor)) let found = false;
let found = false for (let ending in root.allowedVideoFileEndings) {
for (let ending in root.allowedVideoFileEndings) { if (file.endsWith(ending)) {
if (file.endsWith(ending)) { found = true;
found = true break;
break }
} }
} if (found) {
if (found) { root.next(drop.urls[0]);
root.next(drop.urls[0]) } else {
} else { txtFile.text = qsTr("Invalid file type. Must be valid video!");
txtFile.text = qsTr( }
"Invalid file type. Must be valid video!") }
}
}
Rectangle { Rectangle {
id: bg id: bg
@ -95,8 +92,7 @@ Item {
Text { Text {
id: txtFile id: txtFile
text: qsTr("Drag and drop your video here. Supported video formats are:\n\n%1").arg( text: qsTr("Drag and drop your video here. Supported video formats are:\n\n%1").arg(root.allowedVideoFileEndings.join(" "))
root.allowedVideoFileEndings.join(" "))
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
color: Material.primaryTextColor color: Material.primaryTextColor
font.pointSize: 13 font.pointSize: 13
@ -125,8 +121,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
@ -140,7 +135,7 @@ Item {
highlighted: true highlighted: true
font.family: App.settings.font font.family: App.settings.font
onClicked: { onClicked: {
fileDialogImportVideo.open() fileDialogImportVideo.open();
} }
FileDialog { FileDialog {
@ -148,7 +143,7 @@ Item {
nameFilters: ["Video files (*.mp4)"] nameFilters: ["Video files (*.mp4)"]
onAccepted: { onAccepted: {
root.next(fileDialogImportVideo.currentFile) root.next(fileDialogImportVideo.currentFile);
} }
} }

View File

@ -5,7 +5,6 @@ import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: wrapperError id: wrapperError

View File

@ -81,7 +81,6 @@ Item {
value: Video.VideoCodec.VP8 value: Video.VideoCodec.VP8
text: qsTr("VP8 (Better for older hardware)") text: qsTr("VP8 (Better for older hardware)")
} }
} }
} }
} }
@ -111,8 +110,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
@ -126,7 +124,7 @@ Item {
highlighted: true highlighted: true
font.family: App.settings.font font.family: App.settings.font
onClicked: { onClicked: {
root.next(comboBoxCodec.currentValue, sliderQuality.value) root.next(comboBoxCodec.currentValue, sliderQuality.value);
} }
anchors { anchors {
right: parent.right right: parent.right

View File

@ -335,14 +335,7 @@ Item {
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, root.codec, textFieldTags.getTags());
textFieldName.text,
textFieldDescription.text,
root.filePath,
previewSelector.imageSource,
textFieldYoutubeURL.text,
root.codec,
textFieldTags.getTags());
savePopup.open(); savePopup.open();
} }
} }

View File

@ -14,14 +14,9 @@ WizardPage {
id: rightWrapper id: rightWrapper
function create() { function create() {
App.wizards.createQMLWallpaper(tfTitle.text, cbLicense.name, App.wizards.createQMLWallpaper(tfTitle.text, cbLicense.name, cbLicense.licenseFile, tfCreatedBy.text, previewSelector.imageSource, tagSelector.getTags()).then(result => {
cbLicense.licenseFile, wizardFinished(result.success, result.message);
tfCreatedBy.text, });
previewSelector.imageSource,
tagSelector.getTags()).then(
result => {
wizardFinished(result.success, result.message)
})
} }
spacing: 10 spacing: 10

View File

@ -11,15 +11,9 @@ WizardPage {
sourceComponent: ColumnLayout { sourceComponent: ColumnLayout {
function create() { function create() {
App.wizards.createQMLWidget(tfTitle.text, cbLicense.name, App.wizards.createQMLWidget(tfTitle.text, cbLicense.name, cbLicense.licenseFile, tfCreatedBy.text, previewSelector.imageSource, tagSelector.getTags()).then(result => {
cbLicense.licenseFile, wizardFinished(result.success, result.message);
tfCreatedBy.text, });
previewSelector.imageSource,
tagSelector.getTags()).then(result => {
wizardFinished(
result.success,
result.message)
})
} }
Util.Headline { Util.Headline {

View File

@ -10,25 +10,19 @@ import ScreenPlayUtil as Util
WizardPage { WizardPage {
id: root id: root
function isValidURL(string) { function isValidURL(string) {
var res = string.match( var res = string.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);
/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g) return (res !== null);
return (res !== null)
} }
sourceComponent: ColumnLayout { sourceComponent: ColumnLayout {
id: layout id: layout
function validate() { function validate() {
root.ready = tfTitle.text.length >= 1 && root.isValidURL(tfUrl.text) root.ready = tfTitle.text.length >= 1 && root.isValidURL(tfUrl.text);
} }
function create() { function create() {
App.wizards.createWebsiteWallpaper(tfTitle.text, App.wizards.createWebsiteWallpaper(tfTitle.text, previewSelector.imageSource, tfUrl.text, tagSelector.getTags()).then(result => {
previewSelector.imageSource, wizardFinished(result.success, result.message);
tfUrl.text, tagSelector.getTags( });
)).then(result => {
wizardFinished(
result.success,
result.message)
})
} }
spacing: 10 spacing: 10

View File

@ -6,7 +6,6 @@ import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import ScreenPlayApp import ScreenPlayApp
FocusScope { FocusScope {
id: root id: root
@ -74,10 +73,10 @@ FocusScope {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
font.family: App.settings.font font.family: App.settings.font
onClicked: { onClicked: {
btnSave.enabled = false btnSave.enabled = false;
root.saveClicked() root.saveClicked();
savePopup.open() savePopup.open();
loader.item.create() loader.item.create();
} }
} }
} }
@ -86,12 +85,11 @@ FocusScope {
target: root target: root
function onWizardFinished(success, message) { function onWizardFinished(success, message) {
if (success) { if (success) {
timerSave.start() timerSave.start();
return return;
} }
savePopup.title = message;
savePopup.title = message savePopup.standardButtons = Dialog.Ok;
savePopup.standardButtons = Dialog.Ok
} }
} }
@ -104,8 +102,8 @@ FocusScope {
height: 200 height: 200
anchors.centerIn: Overlay.overlay anchors.centerIn: Overlay.overlay
onAccepted: { onAccepted: {
savePopup.close() savePopup.close();
root.wizardExited() root.wizardExited();
} }
title: qsTr("Saving...") title: qsTr("Saving...")
@ -117,8 +115,8 @@ FocusScope {
id: timerSave id: timerSave
interval: 200 + Math.random() * 500 interval: 200 + Math.random() * 500
onTriggered: { onTriggered: {
savePopup.close() savePopup.close();
root.wizardExited() root.wizardExited();
} }
} }
} }

View File

@ -19,70 +19,66 @@ Drawer {
property var type: ContentTypes.InstalledType.QMLWallpaper property var type: ContentTypes.InstalledType.QMLWallpaper
property string contentFolderName property string contentFolderName
onClosed: { onClosed: {
root.contentFolderName = "" root.contentFolderName = "";
root.type = ContentTypes.InstalledType.Unknown root.type = ContentTypes.InstalledType.Unknown;
} }
function setInstalledDrawerItem(folderName, type) { function setInstalledDrawerItem(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)
return return;
root.contentFolderName = folderName;
root.contentFolderName = folderName root.type = type;
root.type = type
if (App.util.isWallpaper(root.type)) { if (App.util.isWallpaper(root.type)) {
if (type === ContentTypes.InstalledType.VideoWallpaper) if (type === ContentTypes.InstalledType.VideoWallpaper)
installedDrawerWrapper.state = "wallpaper" installedDrawerWrapper.state = "wallpaper";
else else
installedDrawerWrapper.state = "scene" installedDrawerWrapper.state = "scene";
btnLaunchContent.text = qsTr("Set Wallpaper") btnLaunchContent.text = qsTr("Set Wallpaper");
} else { } else {
installedDrawerWrapper.state = "widget" installedDrawerWrapper.state = "widget";
btnLaunchContent.text = qsTr("Set Widget") btnLaunchContent.text = qsTr("Set Widget");
} }
root.open() root.open();
} }
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() {
root.close() root.close();
imagePreview.source = "" imagePreview.source = "";
animatedImagePreview.source = "" animatedImagePreview.source = "";
txtHeadline.text = "" txtHeadline.text = "";
installedDrawerWrapper.state = "inactive" installedDrawerWrapper.state = "inactive";
} }
onContentFolderNameChanged: { onContentFolderNameChanged: {
const item = App.installedListModel.get(root.contentFolderName) const item = App.installedListModel.get(root.contentFolderName);
//txtHeadline.text = item.m_title //txtHeadline.text = item.m_title
const previewGiFilePath = Qt.resolvedUrl( const previewGiFilePath = Qt.resolvedUrl(item.m_absoluteStoragePath + "/" + item.m_previewGIF);
item.m_absoluteStoragePath + "/" + item.m_previewGIF) const previewImageFilePath = Qt.resolvedUrl(item.m_absoluteStoragePath + "/" + item.m_preview);
const previewImageFilePath = Qt.resolvedUrl( root.hasPreviewGif = App.util.fileExists(previewGiFilePath);
item.m_absoluteStoragePath + "/" + item.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 (App.util.isWidget(root.type) if (App.util.isWidget(root.type) || (monitorSelection.activeMonitors.length > 0)) {
|| (monitorSelection.activeMonitors.length > 0)) { btnLaunchContent.enabled = true;
btnLaunchContent.enabled = true return;
return
} }
btnLaunchContent.enabled = false btnLaunchContent.enabled = false;
} }
RowLayout { RowLayout {
@ -118,8 +114,8 @@ Drawer {
Layout.fillHeight: true Layout.fillHeight: true
Connections { Connections {
target: App.screenPlayManager target: App.screenPlayManager
function onPrintQmlTimeline(){ function onPrintQmlTimeline() {
timeline.printTimelines() timeline.printTimelines();
} }
} }
} }
@ -136,29 +132,29 @@ Drawer {
} }
} }
ColumnLayout { ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
spacing: 10 spacing: 10
Text { Text {
text: qsTr("Select a Monitor to display the content") text: qsTr("Select a Monitor to display the content")
font.family: App.settings.font font.family: App.settings.font
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.pointSize: 11 font.pointSize: 11
color: Material.secondaryTextColor color: Material.secondaryTextColor
}
MonitorSelection {
id: monitorSelection
objectName: "monitorSelection"
height: 200
Layout.fillWidth: true
availableWidth: width
availableHeight: height
fontSize: 11
}
} }
MonitorSelection {
id: monitorSelection
objectName: "monitorSelection"
height: 200
Layout.fillWidth: true
availableWidth: width
availableHeight: height
fontSize: 11
}
}
} }
ColumnLayout { ColumnLayout {
@ -284,26 +280,30 @@ Drawer {
textRole: "text" textRole: "text"
valueRole: "value" valueRole: "value"
font.family: App.settings.font font.family: App.settings.font
model: [{ model: [
{
"value": Settings.FillMode.Stretch, "value": Settings.FillMode.Stretch,
"text": qsTr("Stretch") "text": qsTr("Stretch")
}, { },
{
"value": Settings.FillMode.Fill, "value": Settings.FillMode.Fill,
"text": qsTr("Fill") "text": qsTr("Fill")
}, { },
{
"value": Settings.FillMode.Contain, "value": Settings.FillMode.Contain,
"text": qsTr("Contain") "text": qsTr("Contain")
}, { },
{
"value": Settings.FillMode.Cover, "value": Settings.FillMode.Cover,
"text": qsTr("Cover") "text": qsTr("Cover")
}, { },
{
"value": Settings.FillMode.Scale_Down, "value": Settings.FillMode.Scale_Down,
"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)
} }
} }
} }
@ -322,80 +322,55 @@ Drawer {
Button { Button {
id: btnLaunchContent id: btnLaunchContent
objectName: "btnLaunchContent" objectName: "btnLaunchContent"
enabled: App.util.isWidget( enabled: App.util.isWidget(root.type) ? true : monitorSelection.isSelected
root.type) ? true : monitorSelection.isSelected
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 item = App.installedListModel.get( const item = App.installedListModel.get(root.contentFolderName);
root.contentFolderName) const absoluteStoragePath = item.m_absoluteStoragePath;
const absoluteStoragePath = item.m_absoluteStoragePath const previewImage = item.m_preview;
const previewImage = item.m_preview
if (App.util.isWallpaper(root.type)) { if (App.util.isWallpaper(root.type)) {
if (type === ContentTypes.InstalledType.GodotWallpaper) { if (type === ContentTypes.InstalledType.GodotWallpaper) {
if (App.globalVariables.isBasicVersion()) { if (App.globalVariables.isBasicVersion()) {
installedDrawerWrapper.state = "inactive" installedDrawerWrapper.state = "inactive";
return return;
} }
} }
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 === ContentTypes.InstalledType.VideoWallpaper) if (type === ContentTypes.InstalledType.VideoWallpaper)
volume = Math.round( volume = Math.round(sliderVolume.slider.value * 100) / 100;
sliderVolume.slider.value * 100) / 100
if (type === ContentTypes.InstalledType.GodotWallpaper) { if (type === ContentTypes.InstalledType.GodotWallpaper) {
App.util.exportGodotProject( App.util.exportGodotProject(absoluteStoragePath, App.globalVariables.godotEditorExecutablePath).then(result => {
absoluteStoragePath, if (!result.success) {
App.globalVariables.godotEditorExecutablePath).then( dialog.title = ("Error exporting Godot");
result => { dialog.message = result.message;
if (!result.success) { dialog.open();
dialog.title = ("Error exporting Godot") } else {
dialog.message = result.message const screenFile = item.m_file;
dialog.open() let success = App.screenPlayManager.createWallpaper(root.type, cbVideoFillMode.currentValue, absoluteStoragePath, previewImage, screenFile, activeMonitors, volume, 1, {}, true);
} else { }
const screenFile = item.m_file });
let success = App.screenPlayManager.createWallpaper( root.close();
root.type, return;
cbVideoFillMode.currentValue,
absoluteStoragePath,
previewImage, screenFile,
activeMonitors, volume,
1, {}, true)
}
})
root.close()
return
} }
const activeTimeline = timeline.getActiveTimeline();
const activeTimeline = timeline.getActiveTimeline() const screenFile = item.m_file;
const screenFile = item.m_file const playbackRate = 1;
const playbackRate = 1 const jsonProperties = {};
const jsonProperties = {}
let success = App.screenPlayManager.setWallpaperAtTimelineIndex( let success = App.screenPlayManager.setWallpaperAtTimelineIndex(
root.type, cbVideoFillMode.currentValue, root.type, cbVideoFillMode.currentValue, absoluteStoragePath, previewImage, screenFile, activeMonitors, volume, playbackRate, jsonProperties, timeline.activeTimelineIndex, activeTimeline.identifier, true);
absoluteStoragePath, previewImage, screenFile,
activeMonitors, volume, playbackRate, jsonProperties,
activeTimeline.activeTimelineIndex,
activeTimeline.identifier,
true)
} }
if (App.util.isWidget(root.type)) if (App.util.isWidget(root.type))
App.screenPlayManager.startWidget(type, App.screenPlayManager.startWidget(type, Qt.point(0, 0), absoluteStoragePath, previewImage, {}, true);
Qt.point(0, 0), root.close();
absoluteStoragePath, monitorSelection.reset();
previewImage, {},
true)
root.close()
monitorSelection.reset()
} }
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
@ -409,8 +384,8 @@ Drawer {
icon.width: 15 icon.width: 15
icon.height: 15 icon.height: 15
onClicked: { onClicked: {
root.close() root.close();
installedDrawerWrapper.state = "inactive" installedDrawerWrapper.state = "inactive";
} }
} }
states: [ states: [

View File

@ -34,8 +34,7 @@ Item {
} }
} }
Util.MouseHoverBlocker { Util.MouseHoverBlocker {}
}
Item { Item {
height: nav.height height: nav.height
@ -49,8 +48,7 @@ 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
@ -63,7 +61,7 @@ Item {
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: {
root.installedDrawer.close() root.installedDrawer.close();
App.installedListFilter.sortBySearchType(Util.ContentTypes.SearchType.All); App.installedListFilter.sortBySearchType(Util.ContentTypes.SearchType.All);
} }
} }
@ -72,7 +70,7 @@ 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: {
root.installedDrawer.close() root.installedDrawer.close();
App.installedListFilter.sortBySearchType(Util.ContentTypes.SearchType.Scene); App.installedListFilter.sortBySearchType(Util.ContentTypes.SearchType.Scene);
} }
} }
@ -81,7 +79,7 @@ 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: {
root.installedDrawer.close() root.installedDrawer.close();
App.installedListFilter.sortBySearchType(Util.ContentTypes.SearchType.Wallpaper); App.installedListFilter.sortBySearchType(Util.ContentTypes.SearchType.Wallpaper);
} }
} }
@ -90,7 +88,7 @@ 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: {
root.installedDrawer.close() root.installedDrawer.close();
App.installedListFilter.sortBySearchType(Util.ContentTypes.SearchType.Widget); App.installedListFilter.sortBySearchType(Util.ContentTypes.SearchType.Widget);
} }
} }
@ -162,8 +160,7 @@ Item {
icon.width: 16 icon.width: 16
height: parent.height height: parent.height
width: implicitWidth width: implicitWidth
background: Item { background: Item {}
}
font.capitalization: Font.MixedCase font.capitalization: Font.MixedCase
} }

View File

@ -21,15 +21,15 @@ Item {
function checkIsContentInstalled() { function checkIsContentInstalled() {
if (App.installedListModel.count === 0) { if (App.installedListModel.count === 0) {
gridView.footerItem.isVisible = true gridView.footerItem.isVisible = true;
gridView.visible = false gridView.visible = false;
navWrapper.visible = false navWrapper.visible = false;
} else { } else {
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;
} }
} }
@ -39,10 +39,9 @@ Item {
width: root.width width: root.width
} }
StackView.onActivated: { StackView.onActivated: {
navWrapper.state = "in" navWrapper.state = "in";
checkIsContentInstalled() checkIsContentInstalled();
} }
Action { Action {
@ -52,12 +51,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
@ -69,7 +68,7 @@ Item {
Connections { Connections {
function onSortChanged() { function onSortChanged() {
gridView.positionViewAtBeginning() gridView.positionViewAtBeginning();
} }
target: App.installedListFilter target: App.installedListFilter
@ -87,6 +86,7 @@ Item {
cellHeight: 200 cellHeight: 200
cacheBuffer: 160 cacheBuffer: 160
interactive: root.enabled interactive: root.enabled
// flickDeceleration: 0.00001
onDragStarted: isDragging = true onDragStarted: isDragging = true
onDragEnded: isDragging = false onDragEnded: isDragging = false
model: App.installedListFilter model: App.installedListFilter
@ -122,12 +122,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 {
@ -144,11 +144,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!");
} }
} }
@ -156,7 +156,7 @@ Item {
interval: 150 interval: 150
running: true running: true
onTriggered: { onTriggered: {
animFadeIn.start() animFadeIn.start();
} }
} }
@ -200,7 +200,7 @@ Item {
interval: 400 interval: 400
running: true running: true
onTriggered: { onTriggered: {
animFadeInTxtFooter.start() animFadeInTxtFooter.start();
} }
} }
@ -228,34 +228,33 @@ Item {
publishedFileID: m_publishedFileID publishedFileID: m_publishedFileID
itemIndex: index itemIndex: index
isScrolling: gridView.isScrolling isScrolling: gridView.isScrolling
onClicked: function(folderName, type){ onClicked: function (folderName, type) {
installedDrawer.setInstalledDrawerItem( folderName, type) installedDrawer.setInstalledDrawerItem(folderName, type);
} }
onOpenOpenLicensePopup: function () { onOpenOpenLicensePopup: function () {
screenPlayProView.open() screenPlayProView.open();
} }
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;
contextMenu.type = delegate.type contextMenu.type = delegate.type;
print(delegate.publishedFileID) print(delegate.publishedFileID);
if (contextMenu.godotItem) if (contextMenu.godotItem)
contextMenu.godotItem.destroy() contextMenu.godotItem.destroy();
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;
if (delegate.type === Util.ContentTypes.InstalledType.GodotWallpaper) { if (delegate.type === Util.ContentTypes.InstalledType.GodotWallpaper) {
contextMenu.godotItem = editGodotWallpaperComp.createObject( contextMenu.godotItem = editGodotWallpaperComp.createObject();
) contextMenu.insertItem(0, contextMenu.godotItem);
contextMenu.insertItem(0, contextMenu.godotItem)
} }
contextMenu.popup(pos.x, pos.y) contextMenu.popup(pos.x, pos.y);
} }
} }
@ -272,9 +271,7 @@ Item {
enabled: contextMenu.type === Util.ContentTypes.InstalledType.GodotWallpaper enabled: contextMenu.type === Util.ContentTypes.InstalledType.GodotWallpaper
icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_edit.svg" icon.source: "qrc:/qml/ScreenPlayApp/assets/icons/icon_edit.svg"
onClicked: { onClicked: {
App.util.openGodotEditor( App.util.openGodotEditor(contextMenu.absoluteStoragePath, App.globalVariables.godotEditorExecutablePath);
contextMenu.absoluteStoragePath,
App.globalVariables.godotEditorExecutablePath)
} }
} }
} }
@ -295,7 +292,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);
} }
} }
@ -304,12 +301,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 = QCore.StandardPaths.writableLocation( let urlFileName = QCore.StandardPaths.writableLocation(QCore.StandardPaths.DesktopLocation) + "/" + contextMenu.fileName + ".screenplay";
QCore.StandardPaths.DesktopLocation) + "/" exportFileDialog.currentFile = urlFileName;
+ contextMenu.fileName + ".screenplay" exportFileDialog.open();
exportFileDialog.currentFile = urlFileName
exportFileDialog.open()
} }
} }
@ -317,21 +312,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.globalVariables.isSteamVersion()
|| !App.globalVariables.isSteamVersion()
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.globalVariables.isSteamVersion()
&& App.globalVariables.isSteamVersion()
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)
} }
} }
} }
@ -344,11 +336,9 @@ Item {
modalSource: root.modalSource modalSource: root.modalSource
anchors.centerIn: Overlay.overlay anchors.centerIn: Overlay.overlay
onAccepted: { onAccepted: {
installedDrawer.close() installedDrawer.close();
if (!App.installedListModel.deinstallItemAt( if (!App.installedListModel.deinstallItemAt(contextMenu.absoluteStoragePath)) {
contextMenu.absoluteStoragePath)) { console.error("Unable to uninstall item", contextMenu.absoluteStoragePath);
console.error("Unable to uninstall item",
contextMenu.absoluteStoragePath)
} }
} }
} }
@ -358,7 +348,7 @@ Item {
fileMode: FileDialog.SaveFile fileMode: FileDialog.SaveFile
property string absoluteStoragePath property string absoluteStoragePath
onAccepted: { onAccepted: {
exportFileProgressDialog.open() exportFileProgressDialog.open();
} }
} }
@ -371,9 +361,7 @@ Item {
modalSource: root.modalSource modalSource: root.modalSource
closePolicy: Popup.NoAutoClose closePolicy: Popup.NoAutoClose
onOpened: { onOpened: {
const success = archive.exportProject( const success = archive.exportProject(exportFileDialog.absoluteStoragePath, exportFileDialog.currentFile);
exportFileDialog.absoluteStoragePath,
exportFileDialog.currentFile)
} }
onClosed: exportProgressBar.value = 0 onClosed: exportProgressBar.value = 0
@ -399,10 +387,10 @@ Item {
id: exportConnections id: exportConnections
target: archive target: archive
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();
} }
} }
} }
@ -427,31 +415,29 @@ 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 = "" var file = "";
// Convert url to string // 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 {
@ -472,11 +458,9 @@ Item {
closePolicy: Popup.NoAutoClose closePolicy: Popup.NoAutoClose
onClosed: importProgressBar.value = 0 onClosed: importProgressBar.value = 0
onOpened: { onOpened: {
const success = archive.importProject( const success = archive.importProject(dropArea.filePath, App.globalVariables.localStoragePath);
dropArea.filePath, print("finished", success);
App.globalVariables.localStoragePath) dropArea.filePath = "";
print("finished", success)
dropArea.filePath = ""
} }
ColumnLayout { ColumnLayout {
width: parent.width width: parent.width
@ -498,10 +482,10 @@ Item {
id: importConnections id: importConnections
target: archive target: archive
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();
} }
} }
} }
@ -517,8 +501,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

@ -20,32 +20,30 @@ Item {
property bool containsAudio: false property bool containsAudio: false
property int version: App.globalVariables.version property int version: App.globalVariables.version
property bool hasLicense: { property bool hasLicense: {
if ((root.version === GlobalVariables.OpenSourceStandalone if ((root.version === GlobalVariables.OpenSourceStandalone || root.version === GlobalVariables.OpenSourceSteam) && root.type === Util.ContentTypes.InstalledType.GodotWallpaper) {
|| root.version === GlobalVariables.OpenSourceSteam) return false;
&& root.type === Util.ContentTypes.InstalledType.GodotWallpaper) {
return false
} }
return true return true;
} }
signal clicked(var screenId, var type) signal clicked(var screenId, var type)
signal openContextMenu(var point) signal openContextMenu(var point)
signal openOpenLicensePopup() signal openOpenLicensePopup
width: 320 width: 320
height: 180 height: 180
onTypeChanged: { onTypeChanged: {
if (App.util.isWidget(type)) { if (App.util.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 (App.util.isScene(type)) { if (App.util.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 (App.util.isVideo(type)) { if (App.util.isVideo(type)) {
icnType.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_movie.svg" icnType.source = "qrc:/qml/ScreenPlayApp/assets/icons/icon_movie.svg";
return return;
} }
} }
@ -53,10 +51,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();
} }
} }
@ -257,26 +255,25 @@ Item {
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
onEntered: { onEntered: {
if (!root.hasLicense) if (!root.hasLicense)
return return;
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 (!root.hasLicense) { if (!root.hasLicense) {
root.openOpenLicensePopup() root.openOpenLicensePopup();
return return;
} }
if (mouse.button === Qt.LeftButton) if (mouse.button === Qt.LeftButton)
root.clicked(root.screenId, root.type) root.clicked(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,31 +11,28 @@ Item {
id: content id: content
anchors.fill: parent anchors.fill: parent
Component.onCompleted: { Component.onCompleted: {
stackView.push( stackView.push("qrc:/qml/ScreenPlayApp/qml/Installed/InstalledView.qml");
"qrc:/qml/ScreenPlayApp/qml/Installed/InstalledView.qml") startTimer.start();
startTimer.start()
} }
function openExitDialog(){ function openExitDialog() {
exitDialog.open() exitDialog.open();
} }
Timer { Timer {
id: startTimer id: startTimer
interval: 10 interval: 10
onTriggered: App.installedListModel.reset() onTriggered: App.installedListModel.reset()
} }
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();
} }
stackView.replace("qrc:/qml/ScreenPlayApp/qml/" + name + "/" + name + "View.qml", { stackView.replace("qrc:/qml/ScreenPlayApp/qml/" + name + "/" + name + "View.qml", {
"modalSource": content "modalSource": content
}); });
nav.setNavigation(name); nav.setNavigation(name);
} }
@ -94,7 +91,6 @@ Item {
target: App.screenPlayManager target: App.screenPlayManager
} }
StackView { StackView {
id: stackView id: stackView
objectName: "stackView" objectName: "stackView"

View File

@ -79,22 +79,28 @@ ColumnLayout {
textRole: "text" textRole: "text"
valueRole: "value" valueRole: "value"
currentIndex: root.indexOfValue(settingsComboBox.model, App.settings.videoFillMode) currentIndex: root.indexOfValue(settingsComboBox.model, App.settings.videoFillMode)
model: [{ model: [
{
"value": Util.Video.FillMode.Stretch, "value": Util.Video.FillMode.Stretch,
"text": qsTr("Stretch") "text": qsTr("Stretch")
}, { },
{
"value": Util.Video.FillMode.Fill, "value": Util.Video.FillMode.Fill,
"text": qsTr("Fill") "text": qsTr("Fill")
}, { },
{
"value": Util.Video.FillMode.Contain, "value": Util.Video.FillMode.Contain,
"text": qsTr("Contain") "text": qsTr("Contain")
}, { },
{
"value": Util.Video.FillMode.Cover, "value": Util.Video.FillMode.Cover,
"text": qsTr("Cover") "text": qsTr("Cover")
}, { },
{
"value": Util.Video.FillMode.Scale_Down, "value": Util.Video.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);
} }

View File

@ -4,7 +4,6 @@ import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
Rectangle { Rectangle {
id: root id: root
@ -69,7 +68,7 @@ Rectangle {
} }
function resize() { function resize() {
print("resize") print("resize");
var absoluteDesktopSize = App.monitorListModel.absoluteDesktopSize(); var absoluteDesktopSize = App.monitorListModel.absoluteDesktopSize();
var isWidthGreaterThanHeight = false; var isWidthGreaterThanHeight = false;
var windowsDelta = 0; var windowsDelta = 0;

View File

@ -6,7 +6,6 @@ import QtQuick.Dialogs
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: root id: root

View File

@ -17,7 +17,7 @@ Util.Popup {
width: 1366 width: 1366
height: 768 height: 768
onOpened: { onOpened: {
monitorSelection.selectMonitorAt(0) monitorSelection.selectMonitorAt(0);
} }
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
@ -31,7 +31,7 @@ Util.Popup {
} }
Connections { Connections {
function onRequestToggleWallpaperConfiguration() { function onRequestToggleWallpaperConfiguration() {
root.open() root.open();
} }
target: App.util target: App.util
@ -73,7 +73,6 @@ Util.Popup {
Timeline { Timeline {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
} }
} }
} }
@ -127,21 +126,18 @@ Util.Popup {
availableHeight: 150 availableHeight: 150
onRequestProjectSettings: function (index, installedType, appID) { onRequestProjectSettings: function (index, installedType, appID) {
if (installedType === Util.ContentTypes.InstalledType.VideoWallpaper) { if (installedType === Util.ContentTypes.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 {
@ -153,7 +149,7 @@ Util.Popup {
Connections { Connections {
function onProjectSettingsListModelResult(listModel) { function onProjectSettingsListModelResult(listModel) {
customPropertiesGridView.projectSettingsListmodelRef = listModel customPropertiesGridView.projectSettingsListmodelRef = listModel;
} }
target: App.screenPlayManager target: App.screenPlayManager
@ -176,38 +172,31 @@ 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(true))
true)) print("Unable to close all wallpaper!");
print("Unable to close all wallpaper!")
} }
} }
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
@ -215,15 +204,14 @@ 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!");
} }
} }
} }
} }
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
@ -290,7 +278,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

@ -4,7 +4,6 @@ import QtQuick.Controls.Material
import QtQuick.Controls.Material.impl import QtQuick.Controls.Material.impl
import ScreenPlayApp import ScreenPlayApp
Rectangle { Rectangle {
id: root id: root

View File

@ -6,12 +6,16 @@ Pane {
Component.onCompleted: { Component.onCompleted: {
// Add the second handle at 100% after the component is fully created // Add the second handle at 100% after the component is fully created
sliderHandles.append({"position": sliderLine.width}); sliderHandles.append({
"position": sliderLine.width
});
} }
ListModel { ListModel {
id: sliderHandles id: sliderHandles
ListElement { position: 0 } // Initial handle at 0% ListElement {
position: 0
} // Initial handle at 0%
} }
Rectangle { Rectangle {
@ -25,7 +29,9 @@ Pane {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
var newHandlePosition = Math.max(0, Math.min(mouseX, sliderLine.width)); var newHandlePosition = Math.max(0, Math.min(mouseX, sliderLine.width));
sliderHandles.append({"position": newHandlePosition}); sliderHandles.append({
"position": newHandlePosition
});
// Sort handles after adding a new one // Sort handles after adding a new one
sortHandles(); sortHandles();
} }
@ -51,7 +57,9 @@ Pane {
drag.maximumX: getMaximumX(index) drag.maximumX: getMaximumX(index)
onReleased: { onReleased: {
sliderHandles.set(index, {"position": handle.x + width / 2}); sliderHandles.set(index, {
"position": handle.x + width / 2
});
} }
} }
} }
@ -66,9 +74,8 @@ Pane {
} }
function sortHandles() { function sortHandles() {
sliderHandles.sort(function(a, b) { sliderHandles.sort(function (a, b) {
return a.position - b.position; return a.position - b.position;
}); });
} }
} }

View File

@ -19,8 +19,7 @@ Util.Popup {
id: root id: root
property ApplicationWindow applicationWindow property ApplicationWindow applicationWindow
contentItem: Pane { contentItem: Pane {
background: Item { background: Item {}
}
padding: 20 padding: 20
bottomPadding: 10 bottomPadding: 10
ColumnLayout { ColumnLayout {

View File

@ -22,29 +22,29 @@ 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) {
for (var i = 0; i < navArray.length; i++) { for (var i = 0; i < navArray.length; i++) {
if (navArray[i].objectName === name) { if (navArray[i].objectName === name) {
navArray[i].state = "active" navArray[i].state = "active";
root.currentNavigationName = name root.currentNavigationName = name;
tabBar.currentIndex = navArray[i].index tabBar.currentIndex = navArray[i].index;
} 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
@ -58,11 +58,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
@ -90,7 +90,7 @@ Rectangle {
objectName: "Create" objectName: "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");
} }
} }
@ -102,7 +102,7 @@ Rectangle {
objectName: "Workshop" objectName: "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");
} }
} }
@ -113,7 +113,7 @@ Rectangle {
objectName: "Installed" objectName: "Installed"
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");
} }
} }
@ -124,7 +124,7 @@ Rectangle {
objectName: "Community" objectName: "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");
} }
} }
@ -135,7 +135,7 @@ Rectangle {
objectName: "Settings" objectName: "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");
} }
} }
} }
@ -163,7 +163,7 @@ Rectangle {
} }
SwipeView { SwipeView {
id:premium id: premium
clip: true clip: true
anchors { anchors {
top: parent.top top: parent.top
@ -177,16 +177,16 @@ Rectangle {
currentIndex: { currentIndex: {
if (App.globalVariables.isBasicVersion()) if (App.globalVariables.isBasicVersion())
return 0 return 0;
if (App.globalVariables.isProVersion()) if (App.globalVariables.isProVersion())
return 1 return 1;
if (App.globalVariables.isUltraVersion()) if (App.globalVariables.isUltraVersion())
return 2 return 2;
return 0 return 0;
} }
ScreenPlayProPopup { ScreenPlayProPopup {
id:screenPlayProView id: screenPlayProView
} }
ToolButton { ToolButton {
@ -197,7 +197,6 @@ Rectangle {
} }
ToolButton { ToolButton {
text: qsTr("ScreenPlay Pro Active") text: qsTr("ScreenPlay Pro Active")
} }
ToolButton { ToolButton {
text: qsTr("ScreenPlay ULTRA Active") text: qsTr("ScreenPlay ULTRA Active")
@ -210,8 +209,7 @@ Rectangle {
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
} }
@ -224,13 +222,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;
} }
} }
@ -246,12 +243,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")
} }
} }
@ -270,13 +266,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
@ -291,10 +285,10 @@ Rectangle {
icon.width: root.iconWidth icon.width: root.iconWidth
icon.height: root.iconHeight icon.height: root.iconHeight
onClicked: { onClicked: {
App.screenPlayManager.removeAllWallpapers(true) App.screenPlayManager.removeAllWallpapers(true);
App.screenPlayManager.removeAllWidgets(true) App.screenPlayManager.removeAllWidgets(true);
miStopAll.isPlaying = true miStopAll.isPlaying = true;
miMuteAll.soundEnabled = true miMuteAll.soundEnabled = true;
} }
hoverEnabled: true hoverEnabled: true

View File

@ -4,7 +4,6 @@ import QtQuick.Layouts
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: settingsBool id: settingsBool

View File

@ -4,7 +4,6 @@ import QtQuick.Layouts
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: settingsButton id: settingsButton

View File

@ -4,7 +4,6 @@ import QtQuick.Layouts
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: root id: root

View File

@ -3,7 +3,6 @@ import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: settingsHeader id: settingsHeader

View File

@ -75,8 +75,7 @@ Item {
// } // }
// } // }
SettingsHorizontalSeperator { SettingsHorizontalSeperator {}
}
SettingBool { SettingBool {
height: 70 height: 70
@ -88,8 +87,7 @@ Item {
} }
} }
SettingsHorizontalSeperator { SettingsHorizontalSeperator {}
}
SettingsButton { SettingsButton {
headline: qsTr("Set save location") headline: qsTr("Set save location")
@ -133,8 +131,7 @@ Item {
} }
} }
SettingsHorizontalSeperator { SettingsHorizontalSeperator {}
}
SettingsComboBox { SettingsComboBox {
id: settingsLanguage id: settingsLanguage
@ -199,15 +196,14 @@ Item {
} }
} }
onActivated: { onActivated: {
let language = settingsLanguage.comboBox.currentValue let language = settingsLanguage.comboBox.currentValue;
App.settings.setLanguage(language); App.settings.setLanguage(language);
App.settings.retranslateUI(); App.settings.retranslateUI();
} }
} }
} }
SettingsHorizontalSeperator { SettingsHorizontalSeperator {}
}
SettingsComboBox { SettingsComboBox {
id: settingsTheme id: settingsTheme
@ -261,8 +257,7 @@ Item {
} }
} }
SettingsHorizontalSeperator { SettingsHorizontalSeperator {}
}
SettingsComboBox { SettingsComboBox {
id: cbVideoFillMode id: cbVideoFillMode
@ -446,8 +441,7 @@ 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"
@ -457,8 +451,7 @@ Item {
onButtonPressed: Qt.openUrlExternally("https://gitlab.com/kelteseth/ScreenPlay/-/releases") onButtonPressed: Qt.openUrlExternally("https://gitlab.com/kelteseth/ScreenPlay/-/releases")
} }
SettingsHorizontalSeperator { SettingsHorizontalSeperator {}
}
SettingsButton { SettingsButton {
headline: qsTr("Third Party Software") headline: qsTr("Third Party Software")
@ -482,8 +475,7 @@ Item {
} }
} }
SettingsHorizontalSeperator { SettingsHorizontalSeperator {}
}
SettingsButton { SettingsButton {
headline: qsTr("Logs") headline: qsTr("Logs")
@ -495,8 +487,7 @@ Item {
} }
} }
SettingsHorizontalSeperator { SettingsHorizontalSeperator {}
}
SettingsButton { SettingsButton {
headline: qsTr("Data Protection") headline: qsTr("Data Protection")

View File

@ -13,8 +13,8 @@ Item {
Component.onCompleted: { Component.onCompleted: {
if (App.globalVariables.isSteamVersion()) { if (App.globalVariables.isSteamVersion()) {
workshopLoader.setSource("qrc:/qml/ScreenPlayWorkshop/qml/SteamWorkshop.qml", { workshopLoader.setSource("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

@ -6,7 +6,6 @@ import QtQuick.Controls.Material.impl
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
Dialog { Dialog {
id: root id: root
property Item modalSource property Item modalSource

View File

@ -4,7 +4,6 @@ import QtQuick.Controls.Material
import QtQuick.Dialogs import QtQuick.Dialogs
import ScreenPlayApp import ScreenPlayApp
/*! /*!
\qmltype Image Selector \qmltype Image Selector
\brief A image selector with popup preview. \brief A image selector with popup preview.

View File

@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: root id: root

View File

@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
Text { Text {
text: qsTr("Headline Section") text: qsTr("Headline Section")
font.pointSize: 14 font.pointSize: 14

View File

@ -4,7 +4,6 @@ import QtQuick.Controls.Material
import QtQuick.Dialogs import QtQuick.Dialogs
import ScreenPlayApp import ScreenPlayApp
/*! /*!
\qmltype Image Selector \qmltype Image Selector
\brief A image selector with popup preview. \brief A image selector with popup preview.

View File

@ -4,7 +4,6 @@ import QtQuick.Layouts
import QtQuick.Controls as QQC import QtQuick.Controls as QQC
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: root id: root

View File

@ -4,7 +4,6 @@ import QtQuick.Controls.Material
import QtQuick.Layouts import QtQuick.Layouts
import ScreenPlayApp import ScreenPlayApp
ColumnLayout { ColumnLayout {
id: root id: root

View File

@ -17,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) {

View File

@ -3,7 +3,6 @@ import QtQuick.Controls
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: tag id: tag

View File

@ -4,7 +4,6 @@ import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material import QtQuick.Controls.Material
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: root id: root
@ -154,8 +153,8 @@ 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 {

View File

@ -5,7 +5,6 @@ import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import ScreenPlayApp import ScreenPlayApp
ColumnLayout { ColumnLayout {
id: root id: root

View File

@ -45,8 +45,8 @@ Item {
onLoadProgressChanged: { onLoadProgressChanged: {
if (loadProgress === 100) { if (loadProgress === 100) {
webView.runJavaScript(root.getSetVideoCommand(), function (result) { webView.runJavaScript(root.getSetVideoCommand(), function (result) {
Wallpaper.requestFadeIn(); Wallpaper.requestFadeIn();
}); });
} }
} }
} }

View File

@ -48,8 +48,7 @@ Rectangle {
onPositionChanged: { onPositionChanged: {
setPosition(); setPosition();
} }
onClicked: { onClicked: {}
}
} }
Rectangle { Rectangle {
@ -213,8 +212,8 @@ Rectangle {
text: "Exit" text: "Exit"
onClicked: { onClicked: {
Qt.callLater(function () { Qt.callLater(function () {
Wallpaper.terminate(); Wallpaper.terminate();
}); });
} }
} }
} }

View File

@ -33,21 +33,21 @@ Rectangle {
break; break;
case ContentTypes.InstalledType.HTMLWallpaper: case ContentTypes.InstalledType.HTMLWallpaper:
loader.setSource("qrc:/qml/ScreenPlayWallpaper/qml/WebsiteWallpaper.qml", { loader.setSource("qrc:/qml/ScreenPlayWallpaper/qml/WebsiteWallpaper.qml", {
"url": Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute) "url": Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute)
}); });
break; break;
case ContentTypes.InstalledType.QMLWallpaper: case ContentTypes.InstalledType.QMLWallpaper:
loader.source = Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute); loader.source = Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute);
break; break;
case ContentTypes.InstalledType.WebsiteWallpaper: case ContentTypes.InstalledType.WebsiteWallpaper:
loader.setSource("qrc:/qml/ScreenPlayWallpaper/qml/WebsiteWallpaper.qml", { loader.setSource("qrc:/qml/ScreenPlayWallpaper/qml/WebsiteWallpaper.qml", {
"url": Wallpaper.projectSourceFileAbsolute "url": Wallpaper.projectSourceFileAbsolute
}); });
break; break;
case ContentTypes.InstalledType.GifWallpaper: case ContentTypes.InstalledType.GifWallpaper:
loader.setSource("qrc:/qml/ScreenPlayWallpaper/qml/GifWallpaper.qml", { loader.setSource("qrc:/qml/ScreenPlayWallpaper/qml/GifWallpaper.qml", {
"source": Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute) "source": Qt.resolvedUrl(Wallpaper.projectSourceFileAbsolute)
}); });
break; break;
} }
} }
@ -193,11 +193,11 @@ Rectangle {
// Must be callLater so we do not kill on startup // Must be callLater so we do not kill on startup
// See emit window.qmlStart(); // See emit window.qmlStart();
Qt.callLater(function () { Qt.callLater(function () {
loader.source = ""; loader.source = "";
Qt.callLater(function () { Qt.callLater(function () {
Wallpaper.terminate(); Wallpaper.terminate();
});
}); });
});
} }
} }
} }

View File

@ -5,7 +5,6 @@ import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: root id: root

View File

@ -200,7 +200,7 @@ Item {
if (!screenPlayItem.hasMenuOpen) if (!screenPlayItem.hasMenuOpen)
screenPlayItem.state = "visible"; screenPlayItem.state = "visible";
} }
onClicked: function(mouse) { onClicked: function (mouse) {
checkBox.toggle(); checkBox.toggle();
if (mouse.button === Qt.LeftButton) if (mouse.button === Qt.LeftButton)
itemClicked(screenPlayItem.folderName, type, checkBox.checkState === Qt.Checked); itemClicked(screenPlayItem.folderName, type, checkBox.checkState === Qt.Checked);

View File

@ -54,8 +54,8 @@ Drawer {
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 {
@ -284,7 +284,7 @@ Drawer {
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumHeight: 150 Layout.minimumHeight: 150
Layout.fillHeight: true //txtDescription.paintedHeight > 100 //txtDescription.paintedHeight > 100
color: Material.backgroundColor color: Material.backgroundColor
radius: 3 radius: 3

View File

@ -17,11 +17,11 @@ 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
}); });
} else { } else {
popupOffline.open(); popupOffline.open();
} }

View File

@ -252,10 +252,10 @@ Item {
icon.source: "qrc:/qml/ScreenPlayWorkshop/assets/icons/icon_account_circle.svg" icon.source: "qrc:/qml/ScreenPlayWorkshop/assets/icons/icon_account_circle.svg"
onClicked: { onClicked: {
stackView.push("qrc:/qml/ScreenPlayWorkshop/qml/SteamProfile.qml", { stackView.push("qrc:/qml/ScreenPlayWorkshop/qml/SteamProfile.qml", {
"screenPlayWorkshop": root.screenPlayWorkshop, "screenPlayWorkshop": root.screenPlayWorkshop,
"steamWorkshop": root.steamWorkshop, "steamWorkshop": root.steamWorkshop,
"stackView": root.stackView "stackView": root.stackView
}); });
} }
} }
@ -272,10 +272,10 @@ Item {
icon.source: "qrc:/qml/ScreenPlayWorkshop/assets/icons/icon_file_upload.svg" icon.source: "qrc:/qml/ScreenPlayWorkshop/assets/icons/icon_file_upload.svg"
onClicked: { onClicked: {
stackView.push("qrc:/qml/ScreenPlayWorkshop/qml/upload/UploadProject.qml", { stackView.push("qrc:/qml/ScreenPlayWorkshop/qml/upload/UploadProject.qml", {
"screenPlayWorkshop": root.screenPlayWorkshop, "screenPlayWorkshop": root.screenPlayWorkshop,
"steamWorkshop": root.steamWorkshop, "steamWorkshop": root.steamWorkshop,
"stackView": root.stackView "stackView": root.stackView
}); });
} }
} }
@ -320,13 +320,13 @@ Item {
print("EDITING FINISHED", root.state); print("EDITING FINISHED", root.state);
if (tiSearch.text === "") { if (tiSearch.text === "") {
Qt.callLater(function () { Qt.callLater(function () {
root.steamWorkshop.searchWorkshop(Util.Steam.EUGCQuery.K_EUGCQuery_RankedByTrend); root.steamWorkshop.searchWorkshop(Util.Steam.EUGCQuery.K_EUGCQuery_RankedByTrend);
}); });
return; return;
} }
Qt.callLater(function () { Qt.callLater(function () {
root.steamWorkshop.searchWorkshopByText(tiSearch.text); root.steamWorkshop.searchWorkshopByText(tiSearch.text);
}); });
} }
anchors { anchors {
@ -346,14 +346,14 @@ Item {
root.state = "searching"; root.state = "searching";
tiSearch.clear(); tiSearch.clear();
Qt.callLater(function () { Qt.callLater(function () {
root.steamWorkshop.searchWorkshop(Util.Steam.EUGCQuery.K_EUGCQuery_RankedByTrend); root.steamWorkshop.searchWorkshop(Util.Steam.EUGCQuery.K_EUGCQuery_RankedByTrend);
}); });
return; return;
} }
root.state = "searching"; root.state = "searching";
Qt.callLater(function () { Qt.callLater(function () {
root.steamWorkshop.searchWorkshopByText(tiSearch.text); root.steamWorkshop.searchWorkshopByText(tiSearch.text);
}); });
} }
icon.width: 20 icon.width: 20
icon.height: 20 icon.height: 20
@ -401,37 +401,48 @@ Item {
valueRole: "value" valueRole: "value"
currentIndex: 2 currentIndex: 2
Layout.preferredHeight: searchWrapper.height Layout.preferredHeight: searchWrapper.height
model: [{ model: [
{
"value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByVote, "value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByVote,
"text": qsTr("Ranked By Vote") "text": qsTr("Ranked By Vote")
}, { },
{
"value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByPublicationDate, "value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByPublicationDate,
"text": qsTr("Publication Date") "text": qsTr("Publication Date")
}, { },
{
"value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByTrend, "value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByTrend,
"text": qsTr("Ranked By Trend") "text": qsTr("Ranked By Trend")
}, { },
{
"value": Util.Steam.EUGCQuery.K_EUGCQuery_FavoritedByFriendsRankedByPublicationDate, "value": Util.Steam.EUGCQuery.K_EUGCQuery_FavoritedByFriendsRankedByPublicationDate,
"text": qsTr("Favorited By Friends") "text": qsTr("Favorited By Friends")
}, { },
{
"value": Util.Steam.EUGCQuery.K_EUGCQuery_CreatedByFriendsRankedByPublicationDate, "value": Util.Steam.EUGCQuery.K_EUGCQuery_CreatedByFriendsRankedByPublicationDate,
"text": qsTr("Created By Friends") "text": qsTr("Created By Friends")
}, { },
{
"value": Util.Steam.EUGCQuery.K_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate, "value": Util.Steam.EUGCQuery.K_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate,
"text": qsTr("Created By Followed Users") "text": qsTr("Created By Followed Users")
}, { },
{
"value": Util.Steam.EUGCQuery.K_EUGCQuery_NotYetRated, "value": Util.Steam.EUGCQuery.K_EUGCQuery_NotYetRated,
"text": qsTr("Not Yet Rated") "text": qsTr("Not Yet Rated")
}, { },
{
"value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByTotalVotesAsc, "value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByTotalVotesAsc,
"text": qsTr("Total VotesAsc") "text": qsTr("Total VotesAsc")
}, { },
{
"value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByVotesUp, "value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByVotesUp,
"text": qsTr("Votes Up") "text": qsTr("Votes Up")
}, { },
{
"value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByTotalUniqueSubscriptions, "value": Util.Steam.EUGCQuery.K_EUGCQuery_RankedByTotalUniqueSubscriptions,
"text": qsTr("Total Unique Subscriptions") "text": qsTr("Total Unique Subscriptions")
}] }
]
onActivated: { onActivated: {
root.state = "searching"; root.state = "searching";
root.steamWorkshop.searchWorkshop(cbQuerySort.currentValue); root.steamWorkshop.searchWorkshop(cbQuerySort.currentValue);

View File

@ -20,11 +20,11 @@ Window {
if (screenPlayWorkshop.init()) { if (screenPlayWorkshop.init()) {
print("init"); print("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
}); });
} else { } else {
popupOffline.open(); popupOffline.open();
} }

View File

@ -5,7 +5,6 @@ import Qt5Compat.GraphicalEffects
import QtQuick.Layouts import QtQuick.Layouts
import ScreenPlayApp import ScreenPlayApp
Item { Item {
id: root id: root
@ -14,8 +13,8 @@ Item {
Component.onCompleted: { Component.onCompleted: {
if (App.globalVariables.isSteamVersion()) { if (App.globalVariables.isSteamVersion()) {
workshopLoader.setSource("qrc:/qml/ScreenPlayApp/qml/Workshop/SteamWorkshop.qml", { workshopLoader.setSource("qrc:/qml/ScreenPlayApp/qml/Workshop/SteamWorkshop.qml", {
"modalSource": modalSource "modalSource": modalSource
}); });
} else { } else {
workshopLoader.setSource("qrc:/qml/ScreenPlayApp/qml/Workshop/Forum.qml"); workshopLoader.setSource("qrc:/qml/ScreenPlayApp/qml/Workshop/Forum.qml");
} }

View File

@ -497,8 +497,7 @@ Page {
State { State {
name: "uploading" name: "uploading"
PropertyChanges { PropertyChanges {}
}
}, },
State { State {
name: "uploadComplete" name: "uploadComplete"