1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-02 00:29:48 +02:00

Add our own Dialog and Popup with blur background

Remove all => for now because the qml formatter does
not like the new syntax
Fix states auf mute/play all buttons
Remove useless playback speed option
This commit is contained in:
Elias Steurer 2022-01-20 16:37:07 +01:00
parent 95f155c889
commit c281ec5599
46 changed files with 12792 additions and 12675 deletions

View File

@ -72,9 +72,12 @@ set(QML
qml/Navigation/Navigation.qml
qml/Navigation/NavigationItem.qml
qml/Navigation/WindowNavButton.qml
qml/Navigation/WindowNavigation.qml
qml/Monitors/DefaultVideoControls.qml
qml/Common/TagSelector.qml
qml/Common/Tag.qml
qml/Common/Popup.qml
qml/Common/Dialog.qml
qml/Common/ImageSelector.qml
qml/Common/Slider.qml
qml/Common/RippleEffect.qml

View File

@ -83,34 +83,7 @@ ApplicationWindow {
}
Item {
id: content
anchors.fill: parent
anchors.margins: 1
Connections {
function onThemeChanged(theme) {
setTheme(theme)
}
target: ScreenPlay.settings
}
Connections {
function onRequestNavigation(nav) {
switchPage(nav)
}
target: ScreenPlay.util
}
Connections {
function onRequestRaise() {
root.show()
}
target: ScreenPlay.screenPlayManager
}
id: noneContentItems
Dialogs.SteamNotAvailable {
id: dialogSteam
modalSource: content
@ -125,107 +98,151 @@ ApplicationWindow {
modalSource: content
}
Common.TrayIcon {
window: root
}
StackView {
id: stackView
objectName: "stackView"
property int duration: 300
anchors {
top: nav.bottom
right: parent.right
bottom: parent.bottom
left: parent.left
}
replaceEnter: Transition {
OpacityAnimator {
from: 0
to: 1
duration: stackView.duration
easing.type: Easing.InOutQuart
}
ScaleAnimator {
from: 0.8
to: 1
duration: stackView.duration
easing.type: Easing.InOutQuart
}
}
replaceExit: Transition {
OpacityAnimator {
from: 1
to: 0
duration: stackView.duration
easing.type: Easing.InOutQuart
}
ScaleAnimator {
from: 1
to: 0.8
duration: stackView.duration
easing.type: Easing.InOutQuart
}
}
}
Connections {
function onSetSidebarActive(active) {
if (active)
sidebar.state = "active"
else
sidebar.state = "inactive"
}
function onSetNavigationItem(pos) {
if (pos === 0)
nav.onPageChanged("Create")
else
nav.onPageChanged("Workshop")
}
target: stackView.currentItem
ignoreUnknownSignals: true
}
Installed.Sidebar {
id: sidebar
objectName: "installedSidebar"
navHeight: nav.height
anchors {
top: parent.top
right: parent.right
bottom: parent.bottom
}
}
Navigation.Navigation {
id: nav
window: root
width: parent.width
modalSource: content
anchors {
top: parent.top
right: parent.right
left: parent.left
}
onChangePage: function (name) {
monitors.close()
switchPage(name)
}
}
Monitors.Monitors {
id: monitors
modalSource: content
}
Common.TrayIcon {
window: root
}
}
Item {
anchors.fill: parent
anchors.margins: 1
Navigation.WindowNavigation {
id: windowNav
z:5
modalSource: content
width: parent.width
window: root
}
Item {
id: content
anchors {
top: windowNav.bottom
right: parent.right
bottom: parent.bottom
left: parent.left
}
Connections {
function onThemeChanged(theme) {
setTheme(theme)
}
target: ScreenPlay.settings
}
Connections {
function onRequestNavigation(nav) {
switchPage(nav)
}
target: ScreenPlay.util
}
Connections {
function onRequestRaise() {
root.show()
}
target: ScreenPlay.screenPlayManager
}
StackView {
id: stackView
objectName: "stackView"
property int duration: 300
anchors {
top: nav.bottom
right: parent.right
bottom: parent.bottom
left: parent.left
}
replaceEnter: Transition {
OpacityAnimator {
from: 0
to: 1
duration: stackView.duration
easing.type: Easing.InOutQuart
}
ScaleAnimator {
from: 0.8
to: 1
duration: stackView.duration
easing.type: Easing.InOutQuart
}
}
replaceExit: Transition {
OpacityAnimator {
from: 1
to: 0
duration: stackView.duration
easing.type: Easing.InOutQuart
}
ScaleAnimator {
from: 1
to: 0.8
duration: stackView.duration
easing.type: Easing.InOutQuart
}
}
}
Connections {
function onSetSidebarActive(active) {
if (active)
sidebar.state = "active"
else
sidebar.state = "inactive"
}
function onSetNavigationItem(pos) {
if (pos === 0)
nav.onPageChanged("Create")
else
nav.onPageChanged("Workshop")
}
target: stackView.currentItem
ignoreUnknownSignals: true
}
Installed.Sidebar {
id: sidebar
objectName: "installedSidebar"
navHeight: nav.height
anchors {
top: parent.top
right: parent.right
bottom: parent.bottom
}
}
Navigation.Navigation {
id: nav
modalSource: content
anchors {
top: parent.top
right: parent.right
left: parent.left
}
onChangePage: function (name) {
monitors.close()
switchPage(name)
}
}
}
}
Rectangle {

View File

@ -0,0 +1,29 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material.impl
import QtQuick.Controls.Material
import ScreenPlay 1.0
Dialog {
id: root
property Item modalSource
dim: true
anchors.centerIn: Overlay.overlay
modal: true
focus: true
Overlay.modal: ModalBackgroundBlur {
id: blurBg
sourceItem: root.modalSource
hideSource: root.hideSource
}
// Workaround for missing animation on hide
// when using hideSource
property bool hideSource: true
onAboutToHide: root.hideSource = false
onAboutToShow: root.hideSource = true
}

View File

@ -5,29 +5,24 @@ import QtQuick.Controls.Material
import QtQuick.Window
import Qt5Compat.GraphicalEffects
import ScreenPlay 1.0
import "../"
import "../" as Common
Dialog {
Common.Dialog {
id: root
property ApplicationWindow window
property string message
property var modalSource
Overlay.modal: ModalBackgroundBlur {
sourceItem: root.modalSource
}
anchors.centerIn: Overlay.overlay
standardButtons: Dialog.Ok | Dialog.Help
onHelpRequested: {
Qt.openUrlExternally("https://forum.screen-play.app/category/7/troubleshooting");
Qt.openUrlExternally(
"https://forum.screen-play.app/category/7/troubleshooting")
}
Connections {
function onDisplayErrorPopup(msg) {
root.message = msg;
root.window.show();
root.open();
root.message = msg
root.window.show()
root.open()
}
target: ScreenPlay.screenPlayManager
@ -55,9 +50,7 @@ Dialog {
effect: ColorOverlay {
color: Material.color(Material.DeepOrange)
}
}
}
Text {
@ -71,9 +64,6 @@ Dialog {
font.pointSize: 16
color: Material.primaryTextColor
}
}
}
}

View File

@ -3,25 +3,17 @@ import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Controls.Material
import ScreenPlay 1.0
import "../"
import "../" as Common
Dialog {
id: dialogMonitorConfigurationChanged
Common.Dialog {
id: root
property var modalSource
modal: true
anchors.centerIn: Overlay.overlay
standardButtons: Dialog.Ok
contentHeight: 250
Overlay.modal: ModalBackgroundBlur {
sourceItem: root.modalSource
}
Connections {
function onMonitorConfigurationChanged() {
dialogMonitorConfigurationChanged.open();
root.open()
}
target: ScreenPlay.monitorListModel
@ -51,10 +43,6 @@ Dialog {
font.pointSize: 16
color: Material.primaryTextColor
}
}
}
}

View File

@ -1,19 +1,11 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "../"
import "../" as Common
Dialog {
Common.Dialog {
id: root
property var modalSource
Overlay.modal: ModalBackgroundBlur {
sourceItem: root.modalSource
}
modal: true
anchors.centerIn: Overlay.overlay
standardButtons: Dialog.Ok
title: qsTr("Could not load steam integration!")
}

View File

@ -3,10 +3,13 @@ import Qt5Compat.GraphicalEffects
FastBlur {
id: root
property var sourceItem
property Item sourceItem
property bool hideSource: true
source: ShaderEffectSource {
id: effectSource
sourceItem: root.sourceItem
live: false
hideSource: root.hideSource
}
radius: 64
transparentBorder: true

View File

@ -0,0 +1,26 @@
import QtQuick
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material
import QtQuick.Layouts
Popup {
id: root
property Item modalSource
// Workaround for missing animation on hide
// when using hideSource
property bool aboutToHide: false
dim: true
anchors.centerIn: Overlay.overlay
modal: true
focus: true
Overlay.modal: ModalBackgroundBlur {
id: blurBg
sourceItem: root.modalSource
hideSource: root.aboutToHide
}
onAboutToHide: root.aboutToHide = false
onClosed: root.aboutToHide = true
}

View File

@ -27,9 +27,10 @@ Item {
TextField {
id: txtSearch
placeholderTextColor: Material.secondaryTextColor
width: 250
height: 40
color: Material.secondaryTextColor
placeholderText: qsTr("Search for Wallpaper & Widgets")
onTextChanged: {
if (txtSearch.text.length === 0)

View File

@ -68,6 +68,7 @@ Item {
font.family: ScreenPlay.settings.font
color: Material.secondaryTextColor
placeholderTextColor: Material.secondaryTextColor
width: parent.width
Keys.onEscapePressed: resetState()
onTextEdited: {

View File

@ -10,19 +10,19 @@ SystemTrayIcon {
visible: true
icon.source: "qrc:/assets/icons/app.ico"
tooltip: qsTr("ScreenPlay - Double click to change you settings.")
onActivated: (reason)=>{
onActivated: function (reason) {
switch (reason) {
case SystemTrayIcon.Unknown:
break;
break
case SystemTrayIcon.Context:
break;
break
case SystemTrayIcon.DoubleClick:
window.show();
break;
window.show()
break
case SystemTrayIcon.Trigger:
break;
break
case SystemTrayIcon.MiddleClick:
break;
break
}
}
@ -30,7 +30,7 @@ SystemTrayIcon {
MenuItem {
text: qsTr("Open ScreenPlay")
onTriggered: {
window.show();
window.show()
}
}
@ -42,13 +42,15 @@ SystemTrayIcon {
text: qsTr("Mute all")
onTriggered: {
if (miMuteAll.isMuted) {
isMuted = false;
miMuteAll.text = qsTr("Mute all");
ScreenPlay.screenPlayManager.setAllWallpaperValue("muted", "true");
isMuted = false
miMuteAll.text = qsTr("Mute all")
ScreenPlay.screenPlayManager.setAllWallpaperValue("muted",
"true")
} else {
isMuted = true;
miMuteAll.text = qsTr("Unmute all");
ScreenPlay.screenPlayManager.setAllWallpaperValue("muted", "false");
isMuted = true
miMuteAll.text = qsTr("Unmute all")
ScreenPlay.screenPlayManager.setAllWallpaperValue("muted",
"false")
}
}
}
@ -61,13 +63,15 @@ SystemTrayIcon {
text: qsTr("Pause all")
onTriggered: {
if (miStopAll.isPlaying) {
isPlaying = false;
miStopAll.text = qsTr("Pause all");
ScreenPlay.screenPlayManager.setAllWallpaperValue("isPlaying", "true");
isPlaying = false
miStopAll.text = qsTr("Pause all")
ScreenPlay.screenPlayManager.setAllWallpaperValue(
"isPlaying", "true")
} else {
isPlaying = true;
miStopAll.text = qsTr("Play all");
ScreenPlay.screenPlayManager.setAllWallpaperValue("isPlaying", "false");
isPlaying = true
miStopAll.text = qsTr("Play all")
ScreenPlay.screenPlayManager.setAllWallpaperValue(
"isPlaying", "false")
}
}
}
@ -76,7 +80,5 @@ SystemTrayIcon {
text: qsTr("Quit")
onTriggered: ScreenPlay.exit()
}
}
}

View File

@ -8,7 +8,7 @@ import ScreenPlay 1.0
Item {
id: root
required property var modalSource
required property Item modalSource
XMLNewsfeed {
anchors {

View File

@ -12,7 +12,7 @@ import ScreenPlay.QMLUtilities 1.0
Item {
id: root
required property var modalSource
required property Item modalSource
Component.onCompleted: {
wizardContentWrapper.state = "in";

View File

@ -21,25 +21,25 @@ Item {
clip: true
CreateWallpaperInit {
onNext: (filePath, codec) => {
startConvert(filePath, codec)
}
onNext: function (filePath, codec) {
startConvert(filePath, codec)
}
function startConvert(filePath, codec) {
root.wizardStarted()
swipeView.currentIndex = 1
createWallpaperVideoImportConvert.codec = codec
createWallpaperVideoImportConvert.filePath = filePath
ScreenPlay.create.createWallpaperStart(filePath, codec, quality)
function startConvert(filePath, codec) {
root.wizardStarted()
swipeView.currentIndex = 1
createWallpaperVideoImportConvert.codec = codec
createWallpaperVideoImportConvert.filePath = filePath
ScreenPlay.create.createWallpaperStart(filePath, codec, quality)
}
}
CreateWallpaperVideoImportConvert {
id: createWallpaperVideoImportConvert
onAbort: root.wizardExited()
}
CreateWallpaperResult {}
}
CreateWallpaperVideoImportConvert {
id: createWallpaperVideoImportConvert
onAbort: root.wizardExited()
}
CreateWallpaperResult {}
}
}

View File

@ -9,9 +9,9 @@ import ScreenPlay.Create 1.0
Item {
id: root
signal wizardStarted()
signal wizardExited()
signal next()
signal wizardStarted
signal wizardExited
signal next
SwipeView {
id: swipeView
@ -21,12 +21,12 @@ Item {
clip: true
ImportWebmInit {
onNext: (filePath) =>{
root.wizardStarted();
swipeView.currentIndex = 1;
createWallpaperVideoImportConvert.filePath = filePath;
ScreenPlay.util.setNavigationActive(false);
ScreenPlay.create.createWallpaperStart(filePath);
onNext: function (filePath) {
root.wizardStarted()
swipeView.currentIndex = 1
createWallpaperVideoImportConvert.filePath = filePath
ScreenPlay.util.setNavigationActive(false)
ScreenPlay.create.createWallpaperStart(filePath)
}
}
@ -35,7 +35,5 @@ Item {
onExit: root.wizardExited()
}
}
}

View File

@ -9,9 +9,9 @@ import ScreenPlay.Create 1.0
Item {
id: root
signal wizardStarted()
signal wizardExited()
signal next()
signal wizardStarted
signal wizardExited
signal next
SwipeView {
id: swipeView
@ -21,12 +21,12 @@ Item {
clip: true
Importh264Init {
onNext: (filePath) =>{
root.wizardStarted();
swipeView.currentIndex = 1;
createWallpaperVideoImportConvert.filePath = filePath;
ScreenPlay.util.setNavigationActive(false);
ScreenPlay.create.importH264(filePath);
onNext: function (filePath) {
root.wizardStarted()
swipeView.currentIndex = 1
createWallpaperVideoImportConvert.filePath = filePath
ScreenPlay.util.setNavigationActive(false)
ScreenPlay.create.importH264(filePath)
}
}
@ -35,7 +35,5 @@ Item {
onExit: root.wizardExited()
}
}
}

View File

@ -119,7 +119,7 @@ Item {
id: btnOpenDocs
text: qsTr("Open Documentation")
Material.background: Material.LightGreen
Material.accent: Material.color(Material.LightGreen)
highlighted: true
icon.source: "qrc:/assets/icons/icon_document.svg"
icon.color: "white"

View File

@ -6,6 +6,7 @@ import QtQuick.Controls.Material.impl
import ScreenPlay 1.0
import ScreenPlay.Enums.InstalledType 1.0
import ScreenPlay.Enums.SearchType 1.0
import "../Common" as Common
Item {
id: root
@ -20,24 +21,24 @@ Item {
function checkIsContentInstalled() {
if (ScreenPlay.installedListModel.count === 0) {
loaderHelp.active = true;
gridView.footerItem.isVisible = true;
gridView.visible = false;
navWrapper.visible = false;
loaderHelp.active = true
gridView.footerItem.isVisible = true
gridView.visible = false
navWrapper.visible = false
} else {
loaderHelp.active = false;
gridView.footerItem.isVisible = false;
refresh = false;
gridView.contentY = -82;
gridView.visible = true;
navWrapper.visible = true;
loaderHelp.active = false
gridView.footerItem.isVisible = false
refresh = false
gridView.contentY = -82
gridView.visible = true
navWrapper.visible = true
}
}
Component.onCompleted: {
navWrapper.state = "in";
ScreenPlay.installedListFilter.sortBySearchType(SearchType.All);
checkIsContentInstalled();
navWrapper.state = "in"
ScreenPlay.installedListFilter.sortBySearchType(SearchType.All)
checkIsContentInstalled()
}
Action {
@ -47,7 +48,7 @@ Item {
Connections {
function onHelperButtonPressed(pos) {
setNavigationItem(pos);
setNavigationItem(pos)
}
target: loaderHelp.item
@ -55,13 +56,12 @@ Item {
Connections {
function onInstalledLoadingFinished() {
checkIsContentInstalled();
checkIsContentInstalled()
}
function onCountChanged(count) {
if (count === 0)
checkIsContentInstalled();
checkIsContentInstalled()
}
target: ScreenPlay.installedListModel
@ -78,7 +78,7 @@ Item {
Connections {
function onSortChanged() {
gridView.positionViewAtBeginning();
gridView.positionViewAtBeginning()
}
target: ScreenPlay.installedListFilter
@ -135,13 +135,12 @@ Item {
}
onContentYChanged: {
if (contentY <= -180)
gridView.headerItem.isVisible = true;
gridView.headerItem.isVisible = true
else
gridView.headerItem.isVisible = false;
gridView.headerItem.isVisible = false
//Pull to refresh
if (contentY <= -180 && !refresh && !isDragging)
ScreenPlay.installedListModel.reset();
ScreenPlay.installedListModel.reset()
}
anchors {
@ -158,11 +157,11 @@ Item {
opacity: 0
onIsVisibleChanged: {
if (isVisible) {
txtHeader.color = Material.accent;
txtHeader.text = qsTr("Refreshing!");
txtHeader.color = Material.accent
txtHeader.text = qsTr("Refreshing!")
} else {
txtHeader.color = "gray";
txtHeader.text = qsTr("Pull to refresh!");
txtHeader.color = "gray"
txtHeader.text = qsTr("Pull to refresh!")
}
}
@ -170,7 +169,7 @@ Item {
interval: 150
running: true
onTriggered: {
animFadeIn.start();
animFadeIn.start()
}
}
@ -192,7 +191,6 @@ Item {
running: false
duration: 1000
}
}
footer: Item {
@ -215,7 +213,7 @@ Item {
interval: 400
running: true
onTriggered: {
animFadeInTxtFooter.start();
animFadeInTxtFooter.start()
}
}
@ -227,9 +225,7 @@ Item {
running: false
duration: 1000
}
}
}
delegate: ScreenPlayItem {
@ -244,24 +240,23 @@ Item {
publishedFileID: m_publishedFileID
itemIndex: index
isScrolling: gridView.isScrolling
onOpenContextMenu: (position)=>{
onOpenContextMenu: function (position) {
// Set the menu to the current item informations
contextMenu.publishedFileID = delegate.publishedFileID;
contextMenu.absoluteStoragePath = delegate.absoluteStoragePath;
const pos = delegate.mapToItem(root, position.x, position.y);
contextMenu.publishedFileID = delegate.publishedFileID
contextMenu.absoluteStoragePath = delegate.absoluteStoragePath
const pos = delegate.mapToItem(root, position.x, position.y)
// Disable duplicate opening. The can happen if we
// call popup when we are in the closing animtion.
if (contextMenu.visible || contextMenu.opened)
return ;
return
contextMenu.popup(pos.x, pos.y);
contextMenu.popup(pos.x, pos.y)
}
}
ScrollBar.vertical: ScrollBar {
snapMode: ScrollBar.SnapOnRelease
}
}
Menu {
@ -302,7 +297,7 @@ Item {
}
}
Dialog {
Common.Dialog {
id: deleteDialog
title: qsTr("Are you sure you want to delete this item?")
standardButtons: Dialog.Ok | Dialog.Cancel

View File

@ -173,14 +173,13 @@ Item {
}
}
Rectangle {
width: 120
height: 20
anchors{
top:parent.top
right:parent.right
anchors {
top: parent.top
right: parent.right
rightMargin: -60
topMargin: -20
}
@ -224,7 +223,7 @@ Item {
screenPlayItemImage.state = "loaded"
screenPlayItemImage.exit()
}
onClicked: (mouse)=> {
onClicked: function (mouse) {
if (mouse.button === Qt.LeftButton)
ScreenPlay.util.setSidebarItem(root.screenId, root.type)
else if (mouse.button === Qt.RightButton)

View File

@ -48,17 +48,6 @@ ColumnLayout {
}
}
SP.Slider {
id: slPlaybackRate
headline: qsTr("Playback rate")
slider.onValueChanged: ScreenPlay.screenPlayManager.setWallpaperValueAtMonitorIndex(activeMonitorIndex, "playbackRate", (Math.round(slPlaybackRate.slider.value * 100) / 100))
Layout.fillWidth: true
slider.stepSize: 0.1
slider.to: 1
Layout.leftMargin: 10
Layout.rightMargin: 10
}
SP.Slider {
id: slCurrentVideoTime
@ -118,6 +107,11 @@ ColumnLayout {
}
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
}
}
states: [

View File

@ -22,96 +22,96 @@ Rectangle {
function selectOnly(index) {
for (var i = 0; i < rp.count; i++) {
if (i === index) {
rp.itemAt(i).isSelected = true;
continue;
rp.itemAt(i).isSelected = true
continue
}
rp.itemAt(i).isSelected = false;
rp.itemAt(i).isSelected = false
}
}
function reset() {
for (var i = 0; i < rp.count; i++) {
rp.itemAt(i).isSelected = false;
rp.itemAt(i).isSelected = false
}
rp.itemAt(0).isSelected = true;
getActiveMonitors();
rp.itemAt(0).isSelected = true
getActiveMonitors()
}
function getActiveMonitors() {
root.activeMonitors = [];
root.activeMonitors = []
for (var i = 0; i < rp.count; i++) {
if (rp.itemAt(i).isSelected)
root.activeMonitors.push(rp.itemAt(i).index);
root.activeMonitors.push(rp.itemAt(i).index)
}
// Must be called manually. When QML properties are getting altered in js the
// property binding breaks
root.activeMonitorsChanged();
return root.activeMonitors;
root.activeMonitorsChanged()
return root.activeMonitors
}
function selectMonitorAt(index) {
if (!multipleMonitorsSelectable)
selectOnly(index);
selectOnly(index)
else
rp.itemAt(index).isSelected = !rp.itemAt(index).isSelected;
getActiveMonitors();
rp.itemAt(index).isSelected = !rp.itemAt(index).isSelected
getActiveMonitors()
if (rp.itemAt(index).hasContent)
root.requestProjectSettings(index, rp.itemAt(index).installedType, rp.itemAt(index).appID);
root.requestProjectSettings(index, rp.itemAt(index).installedType,
rp.itemAt(index).appID)
}
function resize() {
var absoluteDesktopSize = ScreenPlay.monitorListModel.absoluteDesktopSize();
var isWidthGreaterThanHeight = false;
var windowsDelta = 0;
var absoluteDesktopSize = ScreenPlay.monitorListModel.absoluteDesktopSize()
var isWidthGreaterThanHeight = false
var windowsDelta = 0
if (absoluteDesktopSize.width < absoluteDesktopSize.height) {
windowsDelta = absoluteDesktopSize.width / absoluteDesktopSize.height;
isWidthGreaterThanHeight = false;
windowsDelta = absoluteDesktopSize.width / absoluteDesktopSize.height
isWidthGreaterThanHeight = false
} else {
windowsDelta = absoluteDesktopSize.height / absoluteDesktopSize.width;
isWidthGreaterThanHeight = true;
windowsDelta = absoluteDesktopSize.height / absoluteDesktopSize.width
isWidthGreaterThanHeight = true
}
if (rp.count === 1)
availableWidth = availableWidth * 0.66;
availableWidth = availableWidth * 0.66
var dynamicHeight = availableWidth * windowsDelta;
var dynamicWidth = availableHeight * windowsDelta;
var dynamicHeight = availableWidth * windowsDelta
var dynamicWidth = availableHeight * windowsDelta
// Delta (height/width)
var monitorHeightRationDelta = 0;
var monitorWidthRationDelta = 0;
var monitorHeightRationDelta = 0
var monitorWidthRationDelta = 0
if (isWidthGreaterThanHeight) {
monitorHeightRationDelta = dynamicHeight / absoluteDesktopSize.height;
monitorWidthRationDelta = availableWidth / absoluteDesktopSize.width;
monitorHeightRationDelta = dynamicHeight / absoluteDesktopSize.height
monitorWidthRationDelta = availableWidth / absoluteDesktopSize.width
} else {
monitorHeightRationDelta = availableHeight / absoluteDesktopSize.height;
monitorWidthRationDelta = dynamicWidth / absoluteDesktopSize.width;
monitorHeightRationDelta = availableHeight / absoluteDesktopSize.height
monitorWidthRationDelta = dynamicWidth / absoluteDesktopSize.width
}
for (var i = 0; i < rp.count; i++) {
rp.itemAt(i).index = i;
rp.itemAt(i).height = rp.itemAt(i).height * monitorHeightRationDelta;
rp.itemAt(i).width = rp.itemAt(i).width * monitorWidthRationDelta;
rp.itemAt(i).x = rp.itemAt(i).x * monitorWidthRationDelta;
rp.itemAt(i).y = rp.itemAt(i).y * monitorHeightRationDelta;
rp.contentWidth += rp.itemAt(i).width;
rp.contentHeight += rp.itemAt(i).height;
rp.itemAt(i).index = i
rp.itemAt(i).height = rp.itemAt(i).height * monitorHeightRationDelta
rp.itemAt(i).width = rp.itemAt(i).width * monitorWidthRationDelta
rp.itemAt(i).x = rp.itemAt(i).x * monitorWidthRationDelta
rp.itemAt(i).y = rp.itemAt(i).y * monitorHeightRationDelta
rp.contentWidth += rp.itemAt(i).width
rp.contentHeight += rp.itemAt(i).height
}
rp.contentWidth += 200;
rp.contentHeight += 200;
rp.contentWidth += 200
rp.contentHeight += 200
}
color: Material.theme === Material.Light ? Material.background : Qt.darker(Material.background)
color: Material.theme === Material.Light ? Material.background : Qt.darker(
Material.background)
height: availableHeight
width: parent.width
clip: true
layer.enabled: true
Component.onCompleted: {
resize();
resize()
}
Connections {
function onMonitorReloadCompleted() {
resize();
resize()
}
target: ScreenPlay.monitorListModel
@ -142,9 +142,10 @@ Rectangle {
previewImage: m_previewImage
installedType: m_installedType
monitorWithoutContentSelectable: root.monitorWithoutContentSelectable
onMonitorSelected: (index) => root.selectMonitorAt(index)
onMonitorSelected: function (index) {
root.selectMonitorAt(index)
}
}
}
ScrollBar.vertical: ScrollBar {
@ -156,8 +157,5 @@ Rectangle {
policy: ScrollBar.AlwaysOff
snapMode: ScrollBar.SnapOnRelease
}
}
}

View File

@ -6,32 +6,23 @@ import QtQuick.Layouts
import QtQuick.Controls.Material.impl
import ScreenPlay 1.0
import ScreenPlay.Enums.InstalledType 1.0
import "../Common/" as SP
import "../Common/" as Common
Popup {
Common.Popup {
id: root
property string activeMonitorName: ""
property int activeMonitorIndex
property var modalSource
Overlay.modal: SP.ModalBackgroundBlur {
sourceItem: root.modalSource
}
width: 1000
height: 500
dim: true
anchors.centerIn: Overlay.overlay
modal: true
focus: true
onOpened: {
monitorSelection.selectMonitorAt(0);
monitorSelection.selectMonitorAt(0)
}
Connections {
function onRequestToggleWallpaperConfiguration() {
root.open();
root.open()
}
target: ScreenPlay.util
@ -75,7 +66,6 @@ Popup {
left: parent.left
leftMargin: 20
}
}
MonitorSelection {
@ -88,20 +78,23 @@ Popup {
monitorWithoutContentSelectable: false
availableWidth: width - 20
availableHeight: 150
onRequestProjectSettings: ( index, installedType, appID) => {
onRequestProjectSettings: function (index, installedType, appID) {
if (installedType === InstalledType.VideoWallpaper) {
videoControlWrapper.state = "visible";
customPropertiesGridView.visible = false;
const wallpaper = ScreenPlay.screenPlayManager.getWallpaperByAppID(appID);
videoControlWrapper.wallpaper = wallpaper;
videoControlWrapper.state = "visible"
customPropertiesGridView.visible = false
const wallpaper = ScreenPlay.screenPlayManager.getWallpaperByAppID(
appID)
videoControlWrapper.wallpaper = wallpaper
} else {
videoControlWrapper.state = "hidden";
customPropertiesGridView.visible = true;
if(!ScreenPlay.screenPlayManager.requestProjectSettingsAtMonitorIndex(index)){
console.warn("Unable to get requested settings from index: ", index)
videoControlWrapper.state = "hidden"
customPropertiesGridView.visible = true
if (!ScreenPlay.screenPlayManager.requestProjectSettingsAtMonitorIndex(
index)) {
console.warn("Unable to get requested settings from index: ",
index)
}
}
activeMonitorIndex = index;
activeMonitorIndex = index
}
anchors {
@ -113,12 +106,11 @@ Popup {
Connections {
function onProjectSettingsListModelResult(listModel) {
customPropertiesGridView.projectSettingsListmodelRef = listModel;
customPropertiesGridView.projectSettingsListmodelRef = listModel
}
target: ScreenPlay.screenPlayManager
}
}
ColumnLayout {
@ -137,34 +129,39 @@ Popup {
highlighted: true
text: qsTr("Remove selected")
font.family: ScreenPlay.settings.font
enabled: monitorSelection.activeMonitors.length == 1 && ScreenPlay.screenPlayManager.activeWallpaperCounter > 0
enabled: monitorSelection.activeMonitors.length == 1
&& ScreenPlay.screenPlayManager.activeWallpaperCounter > 0
onClicked: {
if (!ScreenPlay.screenPlayManager.removeWallpaperAt(monitorSelection.activeMonitors[0]))
print("Unable to close singel wallpaper");
if (!ScreenPlay.screenPlayManager.removeWallpaperAt(
monitorSelection.activeMonitors[0]))
print("Unable to close singel wallpaper")
}
}
Button {
id: btnRemoveAllWallpape
text: qsTr("Remove all ") + ScreenPlay.screenPlayManager.activeWallpaperCounter + " " + qsTr("Wallpapers")
text: qsTr("Remove all ")
+ ScreenPlay.screenPlayManager.activeWallpaperCounter + " " + qsTr(
"Wallpapers")
Material.background: Material.accent
highlighted: true
font.family: ScreenPlay.settings.font
enabled: ScreenPlay.screenPlayManager.activeWallpaperCounter > 0
onClicked: {
if (!ScreenPlay.screenPlayManager.removeAllWallpapers())
print("Unable to close all wallpaper!");
print("Unable to close all wallpaper!")
root.close();
root.close()
}
}
Button {
id: btnRemoveAllWidgets
text: qsTr("Remove all ") + ScreenPlay.screenPlayManager.activeWidgetsCounter + " " + qsTr("Widgets")
text: qsTr("Remove all ")
+ ScreenPlay.screenPlayManager.activeWidgetsCounter + " " + qsTr(
"Widgets")
Material.background: Material.accent
Material.foreground: Material.primaryTextColor
highlighted: true
@ -172,18 +169,17 @@ Popup {
enabled: ScreenPlay.screenPlayManager.activeWidgetsCounter > 0
onClicked: {
if (!ScreenPlay.screenPlayManager.removeAllWidgets())
print("Unable to close all widgets!");
print("Unable to close all widgets!")
root.close();
root.close()
}
}
}
}
Rectangle {
color: Material.theme === Material.Light ? Material.background : Qt.darker(Material.background)
color: Material.theme === Material.Light ? Material.background : Qt.darker(
Material.background)
radius: 3
clip: true
@ -239,9 +235,7 @@ Popup {
snapMode: ScrollBar.SnapOnRelease
policy: ScrollBar.AlwaysOn
}
}
}
ToolButton {
@ -257,7 +251,6 @@ Popup {
top: parent.top
right: parent.right
}
}
SaveNotification {
@ -268,15 +261,12 @@ Popup {
Connections {
function onProfilesSaved() {
if (root.opened)
saveNotification.open();
saveNotification.open()
}
target: ScreenPlay.screenPlayManager
}
}
}
background: Rectangle {
@ -288,7 +278,5 @@ Popup {
layer.effect: ElevationEffect {
elevation: 6
}
}
}

View File

@ -15,12 +15,10 @@ Rectangle {
property string currentNavigationName: "Installed"
property var navArray: [navCreate, navWorkshop, navInstalled, navSettings, navCommunity]
property bool navActive: true
property ApplicationWindow window
property var modalSource
property Item modalSource
property int iconWidth: 16
property int iconHeight: iconWidth
signal changePage(string name)
function setActive(active) {
@ -51,78 +49,13 @@ Rectangle {
setNavigation(name)
}
height: 89
implicitWidth: 1366
height: 60
width: 1366
color: Material.theme === Material.Light ? "white" : Material.background
layer.enabled: true
Rectangle {
id:navBg
height:29
width:parent.width
color: Material.theme === Material.Light ? Material.background : "#242424"
Text {
id: title
text: qsTr("ScreenPlay Alpha %1 - Open Source Wallpaper And Widgets").arg(ScreenPlay.version())
color: Material.primaryTextColor
anchors{
left:parent.left
leftMargin: 20
verticalCenter: parent.verticalCenter
}
}
}
MouseArea {
id: mouseArea
property var clickPos
anchors.fill: parent
hoverEnabled: true
onPressed: (mouse)=>{
clickPos = {
"x": mouse.x,
"y": mouse.y
};
}
onPositionChanged: {
if (mouseArea.pressed){
let pos = ScreenPlay.cursorPos();
window.setX(pos.x - clickPos.x)
window.setY(pos.y - clickPos.y)
}
}
}
RowLayout {
anchors {
top:navBg.top
right: navBg.right
bottom: navBg.bottom
}
WindowNavButton {
id: miMinimize
Layout.alignment: Qt.AlignVCenter
icon.source: "qrc:/assets/icons/icon_minimize.svg"
onClicked: root.window.hide()
}
WindowNavButton {
id: miquit
Layout.alignment: Qt.AlignVCenter
icon.source: "qrc:/assets/icons/icon_close.svg"
onClicked: {
if(ScreenPlay.screenPlayManager.activeWallpaperCounter === 0
&& ScreenPlay.screenPlayManager.activeWidgetsCounter === 0){
Qt.quit()
return
}
dialog.open()
}
}
layer.effect: ElevationEffect {
elevation: 2
}
Connections {
@ -137,16 +70,12 @@ Rectangle {
target: ScreenPlay.util
}
Row {
id: row
height: 60
anchors {
top:parent.top
topMargin: navBg.height
top: parent.top
right: parent.right
left: parent.left
leftMargin: 20
@ -161,7 +90,9 @@ Rectangle {
name: "Create"
text: qsTr("Create")
iconSource: "qrc:/assets/icons/icon_plus.svg"
onPageClicked: (name)=> {root.onPageChanged(name)}
onPageClicked: function (name) {
root.onPageChanged(name)
}
objectName: "createTab"
}
@ -172,7 +103,9 @@ Rectangle {
name: "Workshop"
text: qsTr("Workshop")
iconSource: "qrc:/assets/icons/icon_steam.svg"
onPageClicked: (name)=> {root.onPageChanged(name)}
onPageClicked: function (name) {
root.onPageChanged(name)
}
objectName: "workshopTab"
}
@ -184,7 +117,9 @@ Rectangle {
text: qsTr("Installed")
amount: ScreenPlay.installedListModel.count
iconSource: "qrc:/assets/icons/icon_installed.svg"
onPageClicked: (name)=> {root.onPageChanged(name)}
onPageClicked: function (name) {
root.onPageChanged(name)
}
objectName: "installedTab"
}
@ -195,7 +130,9 @@ Rectangle {
name: "Community"
text: qsTr("Community")
iconSource: "qrc:/assets/icons/icon_community.svg"
onPageClicked: (name)=> {root.onPageChanged(name)}
onPageClicked: function (name) {
root.onPageChanged(name)
}
objectName: "communityTab"
}
@ -206,27 +143,28 @@ Rectangle {
name: "Settings"
text: qsTr("Settings")
iconSource: "qrc:/assets/icons/icon_settings.svg"
onPageClicked: (name)=> {root.onPageChanged(name)}
onPageClicked: function (name) {
root.onPageChanged(name)
}
objectName: "settingsTab"
}
}
Rectangle {
id:quickActionRowBackground
id: quickActionRowBackground
anchors.centerIn: quickActionRow
width: quickActionRow.width + 5
height: quickActionRow.height - 16
color: Material.theme === Material.Light ? Material.background : "#242424"
border.color: Material.theme === Material.Light ? Material.iconDisabledColor : Qt.darker(Material.background)
border.color: Material.theme === Material.Light ? Material.iconDisabledColor : Qt.darker(
Material.background)
border.width: 1
radius: 3
}
RowLayout {
anchors {
top: parent.top
topMargin: navBg.height
right: quickActionRow.left
rightMargin: 20
bottom: parent.bottom
@ -235,7 +173,8 @@ Rectangle {
ToolButton {
icon.source: "qrc:/assets/icons/font-awsome/patreon-brands.svg"
text: qsTr("Support me on Patreon!")
onClicked: Qt.openUrlExternally("https://www.patreon.com/ScreenPlayApp")
onClicked: Qt.openUrlExternally(
"https://www.patreon.com/ScreenPlayApp")
}
}
@ -243,7 +182,6 @@ Rectangle {
id: quickActionRow
anchors {
top: parent.top
topMargin: navBg.height
right: parent.right
rightMargin: 10
bottom: parent.bottom
@ -253,9 +191,9 @@ Rectangle {
|| ScreenPlay.screenPlayManager.activeWidgetsCounter > 0
onContentActiveChanged: {
if(!contentActive){
miMuteAll.isMuted = false
miStopAll.isPlaying = false
if (!contentActive) {
miMuteAll.soundEnabled = true
miStopAll.isPlaying = true
}
}
@ -267,10 +205,10 @@ Rectangle {
icon.height: root.iconHeight
enabled: quickActionRow.contentActive
onClicked: isMuted = !isMuted
property bool isMuted: false
onIsMutedChanged: {
if (miMuteAll.isMuted) {
onClicked: soundEnabled = !soundEnabled
property bool soundEnabled: true
onSoundEnabledChanged: {
if (miMuteAll.soundEnabled) {
miMuteAll.icon.source = "qrc:/assets/icons/icon_volume.svg"
ScreenPlay.screenPlayManager.setAllWallpaperValue("muted",
"false")
@ -294,7 +232,7 @@ Rectangle {
icon.height: root.iconHeight
onClicked: isPlaying = !isPlaying
property bool isPlaying: true
onIsPlayingChanged:{
onIsPlayingChanged: {
if (miStopAll.isPlaying) {
miStopAll.icon.source = "qrc:/assets/icons/icon_pause.svg"
ScreenPlay.screenPlayManager.setAllWallpaperValue(
@ -321,6 +259,8 @@ Rectangle {
onClicked: {
ScreenPlay.screenPlayManager.removeAllWallpapers()
ScreenPlay.screenPlayManager.removeAllWidgets()
miStopAll.isPlaying = true
miMuteAll.soundEnabled = true
}
hoverEnabled: true
@ -329,39 +269,16 @@ Rectangle {
}
ToolButton {
id: miConfig
Layout.alignment: Qt.AlignVCenter
icon.source: "qrc:/assets/icons/icon_video_settings_black_24dp.svg"
icon.width: root.iconWidth
icon.height: root.iconHeight
onClicked: ScreenPlay.util.setToggleWallpaperConfiguration()
hoverEnabled: true
ToolTip.text: qsTr("Configure Wallpaper")
ToolTip.visible: hovered
}
Dialog {
id: dialog
anchors.centerIn: Overlay.overlay
Overlay.modal: ModalBackgroundBlur {
sourceItem: root.modalSource
}
title: qsTr("Are you sure you want to exit ScreenPlay? \nThis will shut down all Wallpaper and Widgets.")
standardButtons: Dialog.Ok | Dialog.Cancel
onAccepted: Qt.quit()
modal: true
id: miConfig
Layout.alignment: Qt.AlignVCenter
icon.source: "qrc:/assets/icons/icon_video_settings_black_24dp.svg"
icon.width: root.iconWidth
icon.height: root.iconHeight
onClicked: ScreenPlay.util.setToggleWallpaperConfiguration()
hoverEnabled: true
ToolTip.text: qsTr("Configure Wallpaper")
ToolTip.visible: hovered
}
}
layer.effect: ElevationEffect {
elevation: 2
}
states: [

View File

@ -0,0 +1,92 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls.Material
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material.impl
import ScreenPlay 1.0
import "../Workshop"
import "../Common" as Common
Rectangle {
id: root
height: 29
implicitWidth: 1366
color: Material.theme === Material.Light ? Material.background : "#242424"
property Item modalSource
property ApplicationWindow window
Text {
id: title
text: qsTr("ScreenPlay Alpha %1 - Open Source Wallpaper And Widgets").arg(
ScreenPlay.version())
color: Material.primaryTextColor
verticalAlignment: Text.AlignVCenter
anchors {
top: parent.top
left: parent.left
leftMargin: 10
bottom: parent.bottom
}
}
MouseArea {
id: mouseArea
property var clickPos
anchors.fill: parent
hoverEnabled: true
onPressed: function (mouse) {
clickPos = {
"x": mouse.x,
"y": mouse.y
}
}
onPositionChanged: {
if (mouseArea.pressed) {
let pos = ScreenPlay.cursorPos()
window.setX(pos.x - clickPos.x)
window.setY(pos.y - clickPos.y)
}
}
}
RowLayout {
anchors {
top: root.top
right: root.right
bottom: root.bottom
}
WindowNavButton {
id: miMinimize
Layout.alignment: Qt.AlignVCenter
icon.source: "qrc:/assets/icons/icon_minimize.svg"
onClicked: root.window.hide()
}
WindowNavButton {
id: miquit
Layout.alignment: Qt.AlignVCenter
icon.source: "qrc:/assets/icons/icon_close.svg"
onClicked: {
if (ScreenPlay.screenPlayManager.activeWallpaperCounter === 0
&& ScreenPlay.screenPlayManager.activeWidgetsCounter === 0) {
Qt.quit()
return
}
dialog.open()
}
}
}
Common.Dialog {
id: dialog
modalSource: root.modalSource
title: qsTr("Are you sure you want to exit ScreenPlay? \nThis will shut down all Wallpaper and Widgets.")
standardButtons: Dialog.Ok | Dialog.Cancel
onAccepted: Qt.quit()
}
}

View File

@ -18,11 +18,11 @@ Item {
width: parent.width
onAvailableChanged: {
if (!available) {
settingsBool.opacity = 0.5;
radioButton.enabled = false;
settingsBool.opacity = 0.5
radioButton.enabled = false
} else {
settingsButton.opacity = 1;
radioButton.enabled = true;
settingsButton.opacity = 1
radioButton.enabled = true
}
}
@ -45,7 +45,6 @@ Item {
right: parent.right
rightMargin: 20
}
}
Text {
@ -54,8 +53,13 @@ Item {
text: settingsBool.description
wrapMode: Text.WordWrap
linkColor: Material.color(Material.Orange)
onLinkActivated: (link) => Qt.openUrlExternally(link)
color: Material.theme === Material.Light ? Qt.lighter(Material.foreground) : Qt.darker(Material.foreground)
onLinkActivated: function (link) {
Qt.openUrlExternally(link)
}
color: Material.theme === Material.Light ? Qt.lighter(
Material.foreground) : Qt.darker(
Material.foreground)
font.family: ScreenPlay.settings.font
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
@ -69,7 +73,6 @@ Item {
right: radioButton.left
rightMargin: 20
}
}
CheckBox {
@ -78,9 +81,9 @@ Item {
checked: settingsBool.isChecked
onCheckedChanged: {
if (radioButton.checkState === Qt.Checked)
checkboxChanged(true);
checkboxChanged(true)
else
checkboxChanged(false);
checkboxChanged(false)
}
anchors {
@ -88,7 +91,5 @@ Item {
rightMargin: 20
verticalCenter: parent.verticalCenter
}
}
}

View File

@ -12,16 +12,15 @@ import "../Common"
Item {
id: root
required property var modalSource
required property Item modalSource
function indexOfValue(model, value) {
for (var i = 0; i < model.length; i++) {
let ourValue = model[i].value;
let ourValue = model[i].value
if (value === ourValue)
return i;
return i
}
return -1;
return -1
}
Flickable {
@ -74,13 +73,12 @@ Item {
headline: qsTr("Autostart")
description: qsTr("ScreenPlay will start with Windows and will setup your Desktop every time for you.")
isChecked: ScreenPlay.settings.autostart
onCheckboxChanged: (checked) => {
ScreenPlay.settings.setAutostart(checked);
onCheckboxChanged: function (checked) {
ScreenPlay.settings.setAutostart(checked)
}
}
SettingsHorizontalSeperator {
}
SettingsHorizontalSeperator {}
SettingBool {
headline: qsTr("High priority Autostart")
@ -88,49 +86,47 @@ Item {
description: qsTr("This options grants ScreenPlay a higher autostart priority than other apps.")
isChecked: ScreenPlay.settings.highPriorityStart
onCheckboxChanged: {
ScreenPlay.settings.setHighPriorityStart(checked);
ScreenPlay.settings.setHighPriorityStart(checked)
}
}
SettingsHorizontalSeperator {
}
SettingsHorizontalSeperator {}
SettingBool {
height: 70
headline: qsTr("Send anonymous crash reports and statistics")
description: qsTr("Help us make ScreenPlay faster and more stable. All collected data is purely anonymous and only used for development purposes! We use <a href=\"https://sentry.io\">sentry.io</a> to collect and analyze this data. A <b>big thanks to them</b> for providing us with free premium support for open source projects!")
isChecked: ScreenPlay.settings.anonymousTelemetry
onCheckboxChanged: (checked) => {
ScreenPlay.settings.setAnonymousTelemetry(checked);
onCheckboxChanged: function (checked) {
ScreenPlay.settings.setAnonymousTelemetry(checked)
}
}
SettingsHorizontalSeperator {
}
SettingsHorizontalSeperator {}
SettingsButton {
headline: qsTr("Set save location")
buttonText: qsTr("Set location")
description: {
// Remove file:/// so the used does not get confused
let path = ScreenPlay.globalVariables.localStoragePath + "";
let path = ScreenPlay.globalVariables.localStoragePath + ""
if (path.length === 0)
return qsTr("Your storage path is empty!");
return qsTr("Your storage path is empty!")
else
return path.replace('file:///', '');
return path.replace('file:///', '')
}
onButtonPressed: {
folderDialogSaveLocation.open();
folderDialogSaveLocation.open()
}
FolderDialog {
FolderDialog {
id: folderDialogSaveLocation
folder: ScreenPlay.globalVariables.localStoragePath
onAccepted: {
ScreenPlay.settings.setLocalStoragePath(folderDialogSaveLocation.currentFolder);
ScreenPlay.settings.setLocalStoragePath(
folderDialogSaveLocation.currentFolder)
}
}
}
Text {
@ -149,11 +145,9 @@ Item {
left: parent.left
leftMargin: 20
}
}
SettingsHorizontalSeperator {
}
SettingsHorizontalSeperator {}
SettingsComboBox {
id: settingsLanguage
@ -161,60 +155,61 @@ Item {
headline: qsTr("Language")
description: qsTr("Set the ScreenPlay UI Language")
Component.onCompleted: {
settingsLanguage.comboBox.currentIndex = root.indexOfValue(settingsLanguage.comboBox.model, ScreenPlay.settings.language);
settingsLanguage.comboBox.currentIndex = root.indexOfValue(
settingsLanguage.comboBox.model,
ScreenPlay.settings.language)
}
comboBox {
model: [{
"value": Settings.En_US,
"text": "English"
}, {
"value": Settings.De_DE,
"text": "German"
}, {
"value": Settings.Pl_PL,
"text": "Polish"
}, {
"value": Settings.It_IT,
"text": "Italian"
}, {
"value": Settings.Zh_CN,
"text": "Chinese - Simplified"
}, {
"value": Settings.Ru_RU,
"text": "Russian"
}, {
"value": Settings.Fr_FR,
"text": "French"
}, {
"value": Settings.Es_ES,
"text": "Spanish"
}, {
"value": Settings.Ko_KR,
"text": "Korean"
}, {
"value": Settings.Vi_VN,
"text": "Vietnamese"
}, {
"value": Settings.Pt_BR,
"text": "Portuguese (Brazil)"
}, {
"value": Settings.Tr_TR,
"text": "Turkish"
}, {
"value": Settings.Nl_NL,
"text": "Dutch"
}]
"value": Settings.En_US,
"text": "English"
}, {
"value": Settings.De_DE,
"text": "German"
}, {
"value": Settings.Pl_PL,
"text": "Polish"
}, {
"value": Settings.It_IT,
"text": "Italian"
}, {
"value": Settings.Zh_CN,
"text": "Chinese - Simplified"
}, {
"value": Settings.Ru_RU,
"text": "Russian"
}, {
"value": Settings.Fr_FR,
"text": "French"
}, {
"value": Settings.Es_ES,
"text": "Spanish"
}, {
"value": Settings.Ko_KR,
"text": "Korean"
}, {
"value": Settings.Vi_VN,
"text": "Vietnamese"
}, {
"value": Settings.Pt_BR,
"text": "Portuguese (Brazil)"
}, {
"value": Settings.Tr_TR,
"text": "Turkish"
}, {
"value": Settings.Nl_NL,
"text": "Dutch"
}]
onActivated: {
ScreenPlay.settings.setLanguage(settingsLanguage.comboBox.currentValue);
ScreenPlay.settings.retranslateUI();
ScreenPlay.settings.setLanguage(
settingsLanguage.comboBox.currentValue)
ScreenPlay.settings.retranslateUI()
}
}
}
SettingsHorizontalSeperator {
}
SettingsHorizontalSeperator {}
SettingsComboBox {
id: settingsTheme
@ -222,29 +217,29 @@ Item {
headline: qsTr("Theme")
description: qsTr("Switch dark/light theme")
Component.onCompleted: {
settingsTheme.comboBox.currentIndex = root.indexOfValue(settingsTheme.comboBox.model, ScreenPlay.settings.theme);
settingsTheme.comboBox.currentIndex = root.indexOfValue(
settingsTheme.comboBox.model,
ScreenPlay.settings.theme)
}
comboBox {
model: [{
"value": Settings.System,
"text": qsTr("System Default")
}, {
"value": Settings.Dark,
"text": qsTr("Dark")
}, {
"value": Settings.Light,
"text": qsTr("Light")
}]
"value": Settings.System,
"text": qsTr("System Default")
}, {
"value": Settings.Dark,
"text": qsTr("Dark")
}, {
"value": Settings.Light,
"text": qsTr("Light")
}]
onActivated: {
ScreenPlay.settings.setTheme(settingsTheme.comboBox.currentValue);
ScreenPlay.settings.setTheme(
settingsTheme.comboBox.currentValue)
}
}
}
}
}
SettingsPage {
@ -274,13 +269,13 @@ Item {
headline: qsTr("Pause wallpaper video rendering while another app is in the foreground")
description: qsTr("We disable the video rendering (not the audio!) for the best performance. If you have problem you can disable this behaviour here. Wallpaper restart required!")
isChecked: ScreenPlay.settings.checkWallpaperVisible
onCheckboxChanged: (checked) =>{
ScreenPlay.settings.setCheckWallpaperVisible(checked);
onCheckboxChanged: function (checked) {
ScreenPlay.settings.setCheckWallpaperVisible(
checked)
}
}
SettingsHorizontalSeperator {
}
SettingsHorizontalSeperator {}
SettingsComboBox {
id: cbVideoFillMode
@ -288,33 +283,33 @@ Item {
headline: qsTr("Default Fill Mode")
description: qsTr("Set this property to define how the video is scaled to fit the target area.")
Component.onCompleted: {
cbVideoFillMode.comboBox.currentIndex = root.indexOfValue(cbVideoFillMode.comboBox.model, ScreenPlay.settings.videoFillMode);
cbVideoFillMode.comboBox.currentIndex = root.indexOfValue(
cbVideoFillMode.comboBox.model,
ScreenPlay.settings.videoFillMode)
}
comboBox {
onActivated: ScreenPlay.settings.setVideoFillMode(cbVideoFillMode.comboBox.currentValue)
onActivated: ScreenPlay.settings.setVideoFillMode(
cbVideoFillMode.comboBox.currentValue)
model: [{
"value": FillMode.Stretch,
"text": qsTr("Stretch")
}, {
"value": FillMode.Fill,
"text": qsTr("Fill")
}, {
"value": FillMode.Contain,
"text": qsTr("Contain")
}, {
"value": FillMode.Cover,
"text": qsTr("Cover")
}, {
"value": FillMode.Scale_Down,
"text": qsTr("Scale-Down")
}]
"value": FillMode.Stretch,
"text": qsTr("Stretch")
}, {
"value": FillMode.Fill,
"text": qsTr("Fill")
}, {
"value": FillMode.Contain,
"text": qsTr("Contain")
}, {
"value": FillMode.Cover,
"text": qsTr("Cover")
}, {
"value": FillMode.Scale_Down,
"text": qsTr("Scale-Down")
}]
}
}
}
}
SettingsPage {
@ -348,7 +343,8 @@ Item {
Item {
width: parent.width
height: txtHeadline.paintedHeight + txtDescriptionAbout.paintedHeight + wrapperLinks.childrenRect.height + 80
height: txtHeadline.paintedHeight + txtDescriptionAbout.paintedHeight
+ wrapperLinks.childrenRect.height + 80
Text {
id: txtHeadline
@ -366,7 +362,6 @@ Item {
left: parent.left
leftMargin: 20
}
}
Text {
@ -389,7 +384,6 @@ Item {
right: imgLogoHead.left
rightMargin: 60
}
}
RowLayout {
@ -432,7 +426,6 @@ Item {
url: "https://www.reddit.com/r/ScreenPlayApp/"
color: "#FF4500"
}
}
Image {
@ -450,7 +443,6 @@ Item {
right: parent.right
rightMargin: 20
}
}
Image {
@ -472,32 +464,30 @@ Item {
maskSource: mask
smooth: true
}
}
}
SettingsHorizontalSeperator {
}
SettingsHorizontalSeperator {}
SettingsButton {
icon.source: "qrc:/assets/icons/icon_launch.svg"
headline: qsTr("Version")
description: qsTr("ScreenPlay Build Version \n") + ScreenPlay.settings.gitBuildHash
description: qsTr("ScreenPlay Build Version \n")
+ ScreenPlay.settings.gitBuildHash
buttonText: qsTr("Open Changelog")
onButtonPressed: Qt.openUrlExternally("https://gitlab.com/kelteseth/ScreenPlay/-/releases")
onButtonPressed: Qt.openUrlExternally(
"https://gitlab.com/kelteseth/ScreenPlay/-/releases")
}
SettingsHorizontalSeperator {
}
SettingsHorizontalSeperator {}
SettingsButton {
headline: qsTr("Third Party Software")
description: qsTr("ScreenPlay would not be possible without the work of others. A big thank you to: ")
buttonText: qsTr("Licenses")
onButtonPressed: {
ScreenPlay.util.requestAllLicenses();
expanderCopyright.toggle();
ScreenPlay.util.requestAllLicenses()
expanderCopyright.toggle()
}
}
@ -506,23 +496,21 @@ Item {
Connections {
function onAllLicenseLoaded(licensesText) {
expanderCopyright.text = licensesText;
expanderCopyright.text = licensesText
}
target: ScreenPlay.util
}
}
SettingsHorizontalSeperator {
}
SettingsHorizontalSeperator {}
SettingsButton {
headline: qsTr("Logs")
description: qsTr("If your ScreenPlay missbehaves this is a good way to look for answers. This shows all logs and warning during runtime.")
buttonText: qsTr("Show Logs")
onButtonPressed: {
expanderDebug.toggle();
expanderDebug.toggle()
}
}
@ -532,16 +520,15 @@ Item {
text: ScreenPlay.util.debugMessages
}
SettingsHorizontalSeperator {
}
SettingsHorizontalSeperator {}
SettingsButton {
headline: qsTr("Data Protection")
description: qsTr("We use you data very carefully to improve ScreenPlay. We do not sell or share this (anonymous) information with others!")
buttonText: qsTr("Privacy")
onButtonPressed: {
ScreenPlay.util.requestDataProtection();
expanderDataProtection.toggle();
ScreenPlay.util.requestDataProtection()
expanderDataProtection.toggle()
}
}
@ -550,24 +537,18 @@ Item {
Connections {
function onAllDataProtectionLoaded(dataProtectionText) {
expanderDataProtection.text = dataProtectionText;
expanderDataProtection.text = dataProtectionText
}
target: ScreenPlay.util
}
}
}
}
}
ScrollBar.vertical: ScrollBar {
snapMode: ScrollBar.SnapOnRelease
}
}
}

View File

@ -22,7 +22,7 @@ Popup {
}
required property ScreenPlayWorkshop workshop
required property SteamWorkshop steam
required property var modalSource
required property Item modalSource
Overlay.modal: ModalBackgroundBlur {
sourceItem: root.modalSource
}

View File

@ -11,7 +11,7 @@ import "upload/"
Item {
id: root
required property var modalSource
required property Item modalSource
ScreenPlayWorkshop {
id: screenPlayWorkshop

View File

@ -16,7 +16,7 @@ Item {
property ScreenPlayWorkshop screenPlayWorkshop
property StackView stackView
property Background background
property var modalSource
property Item modalSource
Component.onCompleted: {
root.steamWorkshop.searchWorkshop(SteamEnums.K_EUGCQuery_RankedByTrend)
@ -314,7 +314,7 @@ Item {
leftMargin: 20
}
TextField {
Common.TextField {
id: tiSearch
placeholderText: qsTr("Search for Wallpaper and Widgets...")
onEditingFinished: root.steamWorkshop.searchWorkshopByText(

View File

@ -9,7 +9,7 @@ import ScreenPlay
Item {
id: root
required property var modalSource
required property Item modalSource
Component.onCompleted: {
if (ScreenPlay.settings.steamVersion) {

View File

@ -14,7 +14,7 @@ Popup {
height: 400
closePolicy: Popup.NoAutoClose
anchors.centerIn: Overlay.overlay
property var modalSource
property Item modalSource
Overlay.modal: ModalBackgroundBlur {
sourceItem: root.modalSource
}

View File

@ -774,15 +774,6 @@
<source>Configure Wallpaper</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to exit ScreenPlay?
This will shut down all Wallpaper and Widgets.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>ScreenPlay Alpha %1 - Open Source Wallpaper And Widgets</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Support me on Patreon!</source>
<translation type="unfinished"></translation>
@ -795,11 +786,16 @@ This will shut down all Wallpaper and Widgets.</source>
<context>
<name>PopupOffline</name>
<message>
<source>You need to run Steam for this. steamErrorRestart: %1 - steamErrorAPIInit: %2</source>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Back</source>
<source>You need to run Steam to access the Steam Workshop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Steam Error Restart: %1
Steam Error API Init: %2</source>
<translation type="unfinished"></translation>
</message>
</context>
@ -1908,6 +1904,18 @@ This will shut down all Wallpaper and Widgets.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>WindowNavigation</name>
<message>
<source>ScreenPlay Alpha %1 - Open Source Wallpaper And Widgets</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Are you sure you want to exit ScreenPlay?
This will shut down all Wallpaper and Widgets.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>WizardPage</name>
<message>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -41,9 +41,12 @@ Item {
WebEngineView {
id: webView
anchors.fill: parent
url: Qt.resolvedUrl("file://"+ Wallpaper.getApplicationPath() + "/index.html")
onJavaScriptConsoleMessage: (lineNumber, message) => print(lineNumber,
message)
url: Qt.resolvedUrl("file://" + Wallpaper.getApplicationPath(
) + "/index.html")
onJavaScriptConsoleMessage: function (lineNumber, message) {
print(lineNumber, message)
}
onLoadProgressChanged: {
if (loadProgress === 100) {
webView.runJavaScript(root.getSetVideoCommand(),

View File

@ -11,24 +11,25 @@ Item {
Connections {
function onQmlExit() {
if(Qt.platform.os === "windows")
Widget.setWindowBlur(0);
if (Qt.platform.os === "windows")
Widget.setWindowBlur(0)
animFadeOut.start();
animFadeOut.start()
}
function onQmlSceneValueReceived(key, value) {
var obj2 = 'import QtQuick; Item {Component.onCompleted: loader.item.' + key + ' = ' + value + '; }';
var newObject = Qt.createQmlObject(obj2.toString(), root, "err");
newObject.destroy(10000);
var obj2 = 'import QtQuick; Item {Component.onCompleted: loader.item.'
+ key + ' = ' + value + '; }'
var newObject = Qt.createQmlObject(obj2.toString(), root, "err")
newObject.destroy(10000)
}
// Replace wallpaper with QML Scene
function onReloadQML(oldType) {
loader.sourceComponent = undefined;
loader.source = "";
Widget.clearComponentCache();
loader.source = Qt.resolvedUrl(Widget.projectSourceFileAbsolute);
loader.sourceComponent = undefined
loader.source = ""
Widget.clearComponentCache()
loader.source = Qt.resolvedUrl(Widget.projectSourceFileAbsolute)
}
target: Widget
@ -70,24 +71,25 @@ Item {
Component.onCompleted: {
switch (Widget.type) {
case InstalledType.QMLWidget:
loader.source = Qt.resolvedUrl(Widget.projectSourceFileAbsolute);
break;
loader.source = Qt.resolvedUrl(Widget.projectSourceFileAbsolute)
break
case InstalledType.HTMLWidget:
loader.sourceComponent = webViewComponent;
break;
loader.sourceComponent = webViewComponent
break
}
}
onStatusChanged: {
if (loader.status == Loader.Ready) {
if (loader.item.widgetBackground !== undefined)
bgColor.color = loader.item.widgetBackground;
bgColor.color = loader.item.widgetBackground
if (loader.item.widgetBackgroundOpacity !== undefined)
bgColor.opacity = loader.item.widgetBackgroundOpacity;
if (loader.item.widgetWidth !== undefined && loader.item.widgetHeight !== undefined)
Widget.setWidgetSize(loader.item.widgetWidth, loader.item.widgetHeight);
bgColor.opacity = loader.item.widgetBackgroundOpacity
if (loader.item.widgetWidth !== undefined
&& loader.item.widgetHeight !== undefined)
Widget.setWidgetSize(loader.item.widgetWidth,
loader.item.widgetHeight)
}
}
}
@ -102,10 +104,9 @@ Item {
anchors.fill: parent
onJavaScriptConsoleMessage: print(lineNumber, message)
Component.onCompleted: {
webView.url = Qt.resolvedUrl(Widget.sourcePath);
webView.url = Qt.resolvedUrl(Widget.sourcePath)
}
}
}
MouseArea {
@ -115,16 +116,16 @@ Item {
anchors.fill: parent
hoverEnabled: true
onPressed: (mouse)=>{
onPressed: function (mouse) {
clickPos = {
"x": mouse.x,
"y": mouse.y
};
}
}
onPositionChanged: {
if (mouseArea.pressed)
Widget.setPos(Widget.cursorPos().x - clickPos.x, Widget.cursorPos().y - clickPos.y);
Widget.setPos(Widget.cursorPos().x - clickPos.x,
Widget.cursorPos().y - clickPos.y)
}
}
@ -138,9 +139,9 @@ Item {
onEntered: imgClose.opacity = 1
onExited: imgClose.opacity = 0.15
onClicked: {
if(Qt.platform.os === "windows")
Widget.setWindowBlur(0);
animFadeOut.start();
if (Qt.platform.os === "windows")
Widget.setWindowBlur(0)
animFadeOut.start()
}
anchors {
@ -159,9 +160,7 @@ Item {
target: parent
duration: 300
}
}
}
MouseArea {
@ -173,19 +172,17 @@ Item {
height: width
cursorShape: Qt.SizeFDiagCursor
onPressed: {
clickPosition = Qt.point(mouseX, mouseY);
clickPosition = Qt.point(mouseX, mouseY)
}
onPositionChanged: {
if (mouseAreaResize.pressed)
Widget.setWidgetSize(clickPosition.x + mouseX, clickPosition.y + mouseY);
Widget.setWidgetSize(clickPosition.x + mouseX,
clickPosition.y + mouseY)
}
anchors {
bottom: parent.bottom
right: parent.right
}
}
}