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

Formatting

This commit is contained in:
Elias Steurer 2023-06-11 10:07:39 +02:00
parent a4aeccbd1f
commit 6b30e3f242
33 changed files with 297 additions and 238 deletions

View File

@ -12,5 +12,4 @@ Item {
anchors.fill: parent
color: "gray"
}
}

View File

@ -20,7 +20,6 @@ Item {
//Image
property real imgOpacity: .75
Rectangle {
id: gradient
anchors.fill: parent
@ -44,31 +43,31 @@ Item {
anchors.fill: parent
hoverEnabled: true
Component.onCompleted: {
attractor.pointX = parent.width * .5
attractor.pointY = 0
attractor.pointX = parent.width * .5;
attractor.pointY = 0;
}
onPressed: {
//attractor.enabled = true
onPressed:
//attractor.enabled = true
{
}
onPositionChanged: {
attractor.pointX = mouseX
attractor.pointY = mouseY
rct.x = mouseX
rct.y = mouseY
attractor.pointX = mouseX;
attractor.pointY = mouseY;
rct.x = mouseX;
rct.y = mouseY;
}
onReleased: {
//attractor.enabled = false
onReleased:
//attractor.enabled = false
{
}
}
Rectangle {
id:rct
color:"orange"
width:40
height:40
id: rct
color: "orange"
width: 40
height: 40
}
Attractor {
@ -77,11 +76,10 @@ Item {
affectedParameter: Attractor.Acceleration
strength: root.attStrength
proportionalToDistance: Attractor.InverseQuadratic
anchors{
top:parent.top
anchors {
top: parent.top
topMargin: 100
horizontalCenter: parent.horizontalCenter
}
}
@ -133,7 +131,7 @@ Item {
bottom: parent.bottom
bottomMargin: -width * .65
}
SequentialAnimation on opacity {
SequentialAnimation on opacity {
loops: Animation.Infinite
OpacityAnimator {

View File

@ -4,7 +4,7 @@
import QtQuick
Item {
id : clock
id: clock
width: {
if (ListView.view && ListView.view.width >= 200)
return ListView.view.width / Math.floor(ListView.view.width / 200.0);
@ -29,20 +29,23 @@ Item {
function timeChanged() {
var date = new Date;
hours = internationalTime ? date.getUTCHours() + Math.floor(clock.shift) : date.getHours()
night = ( hours < 7 || hours > 19 )
minutes = internationalTime ? date.getUTCMinutes() + ((clock.shift % 1) * 60) : date.getMinutes()
hours = internationalTime ? date.getUTCHours() + Math.floor(clock.shift) : date.getHours();
night = (hours < 7 || hours > 19);
minutes = internationalTime ? date.getUTCMinutes() + ((clock.shift % 1) * 60) : date.getMinutes();
seconds = date.getUTCSeconds();
}
Timer {
interval: 100; running: true; repeat: true;
interval: 100
running: true
repeat: true
onTriggered: clock.timeChanged()
}
Item {
anchors.centerIn: parent
width: 200; height: 240
width: 200
height: 240
Rectangle {
width: 200
@ -51,57 +54,78 @@ Item {
radius: width
}
Image {
x: 92.5; y: 27
x: 92.5
y: 27
source: "hour.png"
transform: Rotation {
id: hourRotation
origin.x: 7.5; origin.y: 73;
origin.x: 7.5
origin.y: 73
angle: (clock.hours * 30) + (clock.minutes * 0.5)
Behavior on angle {
SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
Behavior on angle {
SpringAnimation {
spring: 2
damping: 0.2
modulus: 360
}
}
}
}
Image {
x: 93.5; y: 17
x: 93.5
y: 17
source: "minute.png"
transform: Rotation {
id: minuteRotation
origin.x: 6.5; origin.y: 83;
origin.x: 6.5
origin.y: 83
angle: clock.minutes * 6
Behavior on angle {
SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
Behavior on angle {
SpringAnimation {
spring: 2
damping: 0.2
modulus: 360
}
}
}
}
Image {
x: 97.5; y: 20
x: 97.5
y: 20
source: "second.png"
transform: Rotation {
id: secondRotation
origin.x: 2.5; origin.y: 80;
origin.x: 2.5
origin.y: 80
angle: clock.seconds * 6
Behavior on angle {
SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
Behavior on angle {
SpringAnimation {
spring: 2
damping: 0.2
modulus: 360
}
}
}
}
Image {
anchors.centerIn: background; source: "center.png"
anchors.centerIn: background
source: "center.png"
}
Text {
id: cityLabel
y: 210; anchors.horizontalCenter: parent.horizontalCenter
y: 210
anchors.horizontalCenter: parent.horizontalCenter
color: "white"
font.family: "Helvetica"
font.bold: true; font.pixelSize: 16
style: Text.Raised; styleColor: "black"
font.bold: true
font.pixelSize: 16
style: Text.Raised
styleColor: "black"
}
}
}

View File

@ -19,15 +19,39 @@ Item {
snapMode: ListView.SnapOneItem
highlightRangeMode: ListView.ApplyRange
delegate: Clock { city: cityName; shift: timeShift }
delegate: Clock {
city: cityName
shift: timeShift
}
model: ListModel {
ListElement { cityName: "New York"; timeShift: -4 }
ListElement { cityName: "London"; timeShift: 0 }
ListElement { cityName: "Oslo"; timeShift: 1 }
ListElement { cityName: "Mumbai"; timeShift: 5.5 }
ListElement { cityName: "Tokyo"; timeShift: 9 }
ListElement { cityName: "Brisbane"; timeShift: 10 }
ListElement { cityName: "Los Angeles"; timeShift: -8 }
ListElement {
cityName: "New York"
timeShift: -4
}
ListElement {
cityName: "London"
timeShift: 0
}
ListElement {
cityName: "Oslo"
timeShift: 1
}
ListElement {
cityName: "Mumbai"
timeShift: 5.5
}
ListElement {
cityName: "Tokyo"
timeShift: 9
}
ListElement {
cityName: "Brisbane"
timeShift: 10
}
ListElement {
cityName: "Los Angeles"
timeShift: -8
}
}
}
@ -38,7 +62,11 @@ Item {
source: "arrow.png"
rotation: -90
opacity: clockview.atXBeginning ? 0 : 0.5
Behavior on opacity { NumberAnimation { duration: 500 } }
Behavior on opacity {
NumberAnimation {
duration: 500
}
}
}
Image {
@ -48,6 +76,10 @@ Item {
source: "arrow.png"
rotation: 90
opacity: clockview.atXEnd ? 0 : 0.5
Behavior on opacity { NumberAnimation { duration: 500 } }
Behavior on opacity {
NumberAnimation {
duration: 500
}
}
}
}

View File

@ -8,37 +8,31 @@ Item {
implicitHeight: 100
function timeChanged() {
var date = new Date
var hours = ""
var minutes = ""
var seconds = ""
var date = new Date;
var hours = "";
var minutes = "";
var seconds = "";
if (date.getHours() < 10) {
hours = "0" + date.getHours().toString()
hours = "0" + date.getHours().toString();
} else {
hours = date.getHours().toString()
hours = date.getHours().toString();
}
if (date.getMinutes() < 10) {
minutes = "0" + date.getMinutes().toString()
minutes = "0" + date.getMinutes().toString();
} else {
minutes = date.getMinutes().toString()
minutes = date.getMinutes().toString();
}
if (date.getSeconds() < 10) {
seconds = "0" + date.getSeconds().toString()
seconds = "0" + date.getSeconds().toString();
} else {
seconds = date.getSeconds().toString()
seconds = date.getSeconds().toString();
}
var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
var day = days[ date.getDay() ];
var month = months[ date.getMonth() ];
txtClock.text = hours + ":" + minutes + ":" + seconds
txtDate.text = day + ", " +date.getDay() + " " + month + ", " + date.getFullYear()
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
var day = days[date.getDay()];
var month = months[date.getMonth()];
txtClock.text = hours + ":" + minutes + ":" + seconds;
txtDate.text = day + ", " + date.getDay() + " " + month + ", " + date.getFullYear();
}
Timer {
@ -73,7 +67,7 @@ Item {
font.pixelSize: 12
color: "#59C1FE"
font.weight: Font.Light
font.family:"Segoe UI"
font.family: "Segoe UI"
}
MouseArea {

View File

@ -40,8 +40,8 @@ Item {
MouseArea {
anchors.fill: parent
onClicked: {
print(model.link)
Qt.openUrlExternally(model.link)
print(model.link);
Qt.openUrlExternally(model.link);
}
}
}

View File

@ -17,25 +17,46 @@ Item {
source: "https://rss.dw.com/atom/rss-en-all"
query: "/feed/entry"
onCountChanged: {
console.log("count ",count)
console.log("count ", count);
}
onStatusChanged: {
print("status ",status)
console.log("count ",count)
print("status ", status);
console.log("count ", count);
if (status === XmlListModel.Error) {
console.log("Error: " + errorString);
}
}
XmlListModelRole { name: "published"; elementName: "published" }
XmlListModelRole { name: "rights"; elementName: "rights" }
XmlListModelRole { name: "updated"; elementName: "updated" }
XmlListModelRole { name: "category"; elementName: "category"; attributeName: "term" }
XmlListModelRole { name: "title"; elementName: "title"}
XmlListModelRole { name: "link"; elementName: "link"; attributeName: "href" }
XmlListModelRole { name: "summary"; elementName: "summary"}
XmlListModelRole {
name: "published"
elementName: "published"
}
XmlListModelRole {
name: "rights"
elementName: "rights"
}
XmlListModelRole {
name: "updated"
elementName: "updated"
}
XmlListModelRole {
name: "category"
elementName: "category"
attributeName: "term"
}
XmlListModelRole {
name: "title"
elementName: "title"
}
XmlListModelRole {
name: "link"
elementName: "link"
attributeName: "href"
}
XmlListModelRole {
name: "summary"
elementName: "summary"
}
}
ListView {

View File

@ -12,32 +12,37 @@ Item {
property string contentRaw: model.content
property url href
onContentRawChanged: {
// Define the regular expression to match the image URL
var regex = /<a\s+href="((?:https?:\/\/)?i\.redd\.it\/[^"]+\.jpg)">\[link\]<\/a>/i;
// Define the regular expression to match the image URL
var regex = /<a\s+href="((?:https?:\/\/)?i\.redd\.it\/[^"]+\.jpg)">\[link\]<\/a>/i;
// Parse the image URL from the HTML content
var match = regex.exec(contentRaw);
if (match != null) {
var imageUrl = match[1];
var href = match[2];
img.source = "" + imageUrl
root.href = "" + href
}
// Parse the image URL from the HTML content
var match = regex.exec(contentRaw);
if (match != null) {
var imageUrl = match[1];
var href = match[2];
img.source = "" + imageUrl;
root.href = "" + href;
}
}
Image {
id: img
asynchronous: true
anchors.fill: parent
clip:true
clip: true
fillMode: Image.PreserveAspectCrop
}
Rectangle {
anchors.fill: img
gradient: Gradient {
GradientStop { position: 0; color: "#00333333" }
GradientStop { position: 1; color: "#ff333333" }
GradientStop {
position: 0
color: "#00333333"
}
GradientStop {
position: 1
color: "#ff333333"
}
}
}
@ -57,8 +62,8 @@ Item {
MouseArea {
anchors.fill: parent
onClicked: {
print(model.link)
Qt.openUrlExternally(model.link)
print(model.link);
Qt.openUrlExternally(model.link);
}
}
}

View File

@ -17,8 +17,7 @@ Item {
XmlListModel {
id: feedModel
onStatusChanged: {
print("status ",status)
print("status ", status);
if (status === XmlListModel.Error) {
console.log("Error: " + errorString);
}
@ -27,12 +26,27 @@ Item {
source: "https://www.reddit.com/r/" + root.subreddit + "/.rss"
query: "/feed/entry"
XmlListModelRole { name: "updated"; elementName: "updated" }
XmlListModelRole { name: "subtitle"; elementName: "subtitle"}
XmlListModelRole { name: "content"; elementName: "content"}
XmlListModelRole { name: "link"; elementName: "link"; attributeName: "href" }
XmlListModelRole { name: "title"; elementName: "title"}
XmlListModelRole {
name: "updated"
elementName: "updated"
}
XmlListModelRole {
name: "subtitle"
elementName: "subtitle"
}
XmlListModelRole {
name: "content"
elementName: "content"
}
XmlListModelRole {
name: "link"
elementName: "link"
attributeName: "href"
}
XmlListModelRole {
name: "title"
elementName: "title"
}
}
ListView {

View File

@ -11,8 +11,7 @@ Item {
id: root
implicitWidth: 1200
implicitHeight: 600
Material.theme: Material.Dark
Material.accent: Material.DeepOrange
@ -36,7 +35,6 @@ Item {
return out;
}
RowLayout {
id: wrapper
spacing: 40

View File

@ -13,7 +13,6 @@ Item {
implicitWidth: 900
implicitHeight: 650
Material.theme: Material.Dark
Material.accent: Material.DeepOrange

View File

@ -16,11 +16,11 @@ Item {
anchors.fill: parent
onStatusChanged: {
if (img.status !== Image.Ready)
return
if(img.sourceSize.width === 0 || img.sourceSize.height === 0)
return
root.implicitHeight = img.sourceSize.height
root.implicitWidth = img.sourceSize.width
return;
if (img.sourceSize.width === 0 || img.sourceSize.height === 0)
return;
root.implicitHeight = img.sourceSize.height;
root.implicitWidth = img.sourceSize.width;
}
fillMode: Image.PreserveAspectCrop
@ -28,25 +28,25 @@ Item {
Component.onCompleted: {
request("http://xkcd.com/info.0.json", function (o) {
if (o.status === 200) {
var d = eval('new Object(' + o.responseText + ')')
console.log(o.responseText)
img.source = d.img
} else {
console.log("Some error has occurred")
}
})
if (o.status === 200) {
var d = eval('new Object(' + o.responseText + ')');
console.log(o.responseText);
img.source = d.img;
} else {
console.log("Some error has occurred");
}
});
}
function request(url, callback) {
var xhr = new XMLHttpRequest()
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = (function (myxhr) {
return function () {
if (myxhr.readyState === 4)
callback(myxhr)
}
})(xhr)
xhr.open('GET', url)
xhr.send('')
return function () {
if (myxhr.readyState === 4)
callback(myxhr);
};
})(xhr);
xhr.open('GET', url);
xhr.send('');
}
}

View File

@ -97,8 +97,8 @@ set(QML
qml/Settings/SettingsHeader.qml
qml/Settings/SettingsHorizontalSeperator.qml
qml/Settings/SettingsPage.qml
qml/Workshop/Workshop.qml
qml/TrayIcon.qml)
qml/TrayIcon.qml
qml/Workshop/Workshop.qml)
set(TS_FILES
# cmake-format: sort
@ -191,8 +191,8 @@ set(RESOURCES
assets/images/noisy-texture.png
assets/images/scale_window_indicator.png
assets/images/steam_offline.png
assets/images/trayIcon_windows.png
assets/images/trayIcon_osx.png
assets/images/trayIcon_windows.png
assets/images/Window.svg
assets/licenses/Apache2.txt
assets/licenses/OFL.txt
@ -383,21 +383,20 @@ if(APPLE AND OSX_BUNDLE)
set(CPACK_BINARY_DRAGNDROP ON)
set(CPACK_BUNDLE_NAME "ScreenPlay")
set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/icons/app.ico")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/icons/app.ico")
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/icons/app.ico")
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist")
set(CPACK_BUNDLE_APPLE_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/entitlements.plist")
set(CPACK_PACKAGE_FILE_NAME "ScreenPlay-0.15")
include(CPack)
# Install all files from /bin
install(
DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
COMPONENT ScreenPlay
DESTINATION "./")
# Install all files from /bin
install(
DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
COMPONENT ScreenPlay
DESTINATION "./")
endif()
if(APPLE AND NOT OSX_BUNDLE)
# Creates a ScreenPlay.app
set_target_properties(
@ -448,4 +447,4 @@ endif()
# ##### USE CMAKE VARIABLES IN CODE #####
include(GenerateCMakeVariableHeader)
generate_cmake_variable_header(${PROJECT_NAME})
generate_cmake_variable_header(${PROJECT_NAME})

View File

@ -18,7 +18,6 @@ Q_IMPORT_QML_PLUGIN(ScreenPlayAppPlugin)
Q_IMPORT_QML_PLUGIN(ScreenPlayUtilPlugin)
Q_IMPORT_QML_PLUGIN(PlausiblePlugin)
int main(int argc, char* argv[])
{

View File

@ -11,7 +11,6 @@ import Settings
import ScreenPlayUtil as Util
import Qt5Compat.GraphicalEffects
import Plausible 1.0
import "qml/Monitors" as Monitors
import "qml/Installed" as Installed
import "qml/Navigation" as Navigation
@ -68,8 +67,6 @@ ApplicationWindow {
debug: false
}
// Partial workaround for
// https://bugreports.qt.io/browse/QTBUG-86047
Material.accent: Material.color(Material.Orange)
@ -163,11 +160,11 @@ ApplicationWindow {
}
function onActiveWidgetsCounterChanged() {
plausible.pageView("widget/count/" + App.screenPlayManager.activeWidgetsCounter)
plausible.pageView("widget/count/" + App.screenPlayManager.activeWidgetsCounter);
}
function onActiveWallpaperCounterChanged() {
plausible.pageView("wallpaper/count/" + App.screenPlayManager.activeWallpaperCounter)
plausible.pageView("wallpaper/count/" + App.screenPlayManager.activeWallpaperCounter);
}
target: App.screenPlayManager

View File

@ -42,7 +42,7 @@ Item {
}
GradientStop {
position: 0
position: 0
color: "transparent"
}
}

View File

@ -5,7 +5,6 @@ import QtQuick.Effects
import QtQuick.Layouts
import QtQuick.Particles
Rectangle {
id: root
color: "#333333"

View File

@ -49,7 +49,8 @@ Item {
TabBar {
height: parent.height
background: Item {}
background: Item {
}
anchors {
top: parent.top
topMargin: 5
@ -108,7 +109,7 @@ Item {
placeholderTextColor: Material.secondaryTextColor
placeholderText: qsTr("Search for Wallpaper & Widgets")
Layout.preferredHeight: 30
Layout.preferredWidth : 350
Layout.preferredWidth: 350
Layout.alignment: Qt.AlignVCenter
color: Material.secondaryTextColor
onTextChanged: {
@ -117,7 +118,6 @@ Item {
else
App.installedListFilter.sortByName(txtSearch.text);
}
}
ToolButton {
id: icnSearch
@ -129,7 +129,6 @@ Item {
icon.height: height
icon.color: Material.iconColor
}
}
ToolButton {

View File

@ -18,9 +18,10 @@ import Qt5Compat.GraphicalEffects
Util.Popup {
id: root
property ApplicationWindow applicationWindow
contentItem: Pane {
background: Item{}
padding:20
contentItem: Pane {
background: Item {
}
padding: 20
bottomPadding: 10
ColumnLayout {
spacing: 20
@ -40,13 +41,13 @@ Util.Popup {
Layout.alignment: Qt.AlignHCenter
source: {
if (Qt.platform.os === "windows") {
return "qrc:/qml/ScreenPlayApp/assets/images/trayIcon_windows.png"
return "qrc:/qml/ScreenPlayApp/assets/images/trayIcon_windows.png";
}
if (Qt.platform.os === "osx") {
return "qrc:/qml/ScreenPlayApp/assets/images/trayIcon_osx.png"
return "qrc:/qml/ScreenPlayApp/assets/images/trayIcon_osx.png";
}
}
fillMode: Image.PreserveAspectFit
}
@ -78,7 +79,7 @@ Util.Popup {
Layout.fillWidth: true
Button {
text: qsTr("Quit ScreenPlay now")
onClicked: App.exit();
onClicked: App.exit()
}
Button {
text: qsTr("Minimize ScreenPlay")
@ -94,7 +95,7 @@ Util.Popup {
onClicked: {
settings.setValue("alwaysMinimize", true);
settings.sync();
print(settings.value("alwaysMinimize"))
print(settings.value("alwaysMinimize"));
App.showDockIcon(false);
applicationWindow.hide();
root.close();

View File

@ -106,7 +106,7 @@ Item {
FolderDialog {
id: folderDialogSaveLocation
currentFolder : App.globalVariables.localStoragePath
currentFolder: App.globalVariables.localStoragePath
onAccepted: {
App.settings.setLocalStoragePath(folderDialogSaveLocation.currentFolder);
}

View File

@ -1,8 +1,8 @@
// SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only
#pragma once
#include <QtCore/qmetatype.h>
#include <QObject>
#include <QtCore/qmetatype.h>
namespace ScreenPlay {
/*!
\namespace ScreenPlay::SearchType

View File

@ -7,8 +7,8 @@ import ScreenPlayApp
import ScreenPlay
ColumnLayout {
id:root
id: root
implicitHeight: 70
implicitWidth: 150
property alias text: textField.text
@ -19,12 +19,12 @@ ColumnLayout {
id: textField
Layout.fillWidth: true
}
Text {
id: requiredText
text: root.required ? qsTr("*Required") : ""
font.family: App.settings.font
color: Material.secondaryTextColor
color: Material.secondaryTextColor
Layout.alignment: Qt.AlignRight
}
}

View File

@ -98,10 +98,7 @@ if(APPLE)
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/index.html
${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/)
set_target_properties(${PROJECT_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/"
)
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
endif()
endif()
@ -114,4 +111,4 @@ endif()
# ##### USE CMAKE VARIABLES IN CODE #####
include(GenerateCMakeVariableHeader)
generate_cmake_variable_header(${PROJECT_NAME})
generate_cmake_variable_header(${PROJECT_NAME})

View File

@ -1,7 +1,6 @@
import QtQuick
import ScreenPlayWallpaper
AnimatedImage {
Component.onCompleted: Wallpaper.requestFadeIn();
Component.onCompleted: Wallpaper.requestFadeIn()
}

View File

@ -37,7 +37,7 @@ Item {
id: mediaPlayer
onPlaybackStateChanged: {
if (mediaPlayer.playbackState == MediaPlayer.PlayingState && !fadeInDone) {
fadeInDone = true
fadeInDone = true;
Wallpaper.requestFadeIn();
}
}

View File

@ -23,7 +23,7 @@ Rectangle {
color: Material.color(Material.Grey, Material.Shade800)
border.width: 10
border.color: "orange"
Component.onCompleted: Wallpaper.requestFadeIn();
Component.onCompleted: Wallpaper.requestFadeIn()
MouseArea {

View File

@ -118,7 +118,7 @@ Rectangle {
root.canFadeByWallpaperFillMode = false;
break;
}
// NOTE: If we do not set it visible here
// NOTE: If we do not set it visible here
// AND in the fadeIn function we get a white frame
Wallpaper.setVisible(true);
}
@ -131,14 +131,13 @@ Rectangle {
imgCover.opacity = 0;
}
Connections {
target: Wallpaper
function onQmlStart(){
root.start()
function onQmlStart() {
root.start();
}
function onFadeIn(){
root.fadeIn()
function onFadeIn() {
root.fadeIn();
}
function onQmlExit() {
if (canFadeByWallpaperFillMode && Wallpaper.canFade)
@ -176,7 +175,6 @@ Rectangle {
return;
loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaView.qml";
}
}
Loader {
id: loader
@ -186,22 +184,20 @@ Rectangle {
//asynchronous: true
onStatusChanged: {
if (loader.status === Loader.Ready) {
if(Wallpaper.type === InstalledType.QMLWallpaper) {
if (Wallpaper.type === InstalledType.QMLWallpaper) {
root.fadeIn();
}
}
if (loader.status === Loader.Error) {
print("ScreenPlayWallpaper encountered an error and will be terminated.")
print("ScreenPlayWallpaper encountered an error and will be terminated.");
// Must be callLater so we do not kill on startup
// See emit window.qmlStart();
Qt.callLater(function(){
loader.source = ""
Qt.callLater(function(){
Wallpaper.terminate()
})
})
Qt.callLater(function () {
loader.source = "";
Qt.callLater(function () {
Wallpaper.terminate();
});
});
}
}
}
@ -282,7 +278,6 @@ Rectangle {
]
}
FrameAnimation {
id: frameAnimation
property real fps: smoothFrameTime > 0 ? (1.0 / smoothFrameTime) : 0
@ -290,7 +285,7 @@ Rectangle {
readonly property real maxFPS: 24.0
readonly property real maxPeriod: 1.0 / maxFPS
readonly property int skipFrames: fps / maxFPS
running: Wallpaper.debugMode
running: Wallpaper.debugMode
}
Pane {
@ -311,10 +306,9 @@ Rectangle {
visible: Wallpaper.debugMode
enabled: Wallpaper.debugMode
font.pointSize: 14
text: "fps: " + frameAnimation.fps.toFixed(0) + " - Frame time:"+ frameAnimation.ft + " ms"
text: "fps: " + frameAnimation.fps.toFixed(0) + " - Frame time:" + frameAnimation.ft + " ms"
}
Text {
text: "appID " + Wallpaper.appID
font.pointSize: 14

View File

@ -26,7 +26,7 @@ Item {
onJavaScriptConsoleMessage: print(lineNumber, message)
onLoadProgressChanged: {
if (loadProgress === 100)
Wallpaper.requestFadeIn();
Wallpaper.requestFadeIn();
}
}
}

View File

@ -77,13 +77,9 @@ if(WIN32)
endif()
if(APPLE AND NOT OSX_BUNDLE)
set_target_properties(${PROJECT_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/"
)
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
endif()
# ##### USE CMAKE VARIABLES IN CODE #####
include(GenerateCMakeVariableHeader)
generate_cmake_variable_header(${PROJECT_NAME})
generate_cmake_variable_header(${PROJECT_NAME})

View File

@ -1,11 +1,11 @@
// SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only
#include "ScreenPlayWidget/CMakeVariables.h"
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlExtensionPlugin>
#include <QString>
#include <QStringList>
#include <QQmlExtensionPlugin>
#include "ScreenPlayWidget/CMakeVariables.h"
#include "src/widgetwindow.h"
@ -25,7 +25,6 @@ int main(int argc, char* argv[])
qputenv("QT_MEDIA_BACKEND", "ffmpeg");
#endif
QGuiApplication app(argc, argv);
const QStringList argumentList = app.arguments();

View File

@ -196,7 +196,7 @@ Item {
target: imgClose
opacity: .5
}
PropertyChanges {
target: bg
opacity: .3

View File

@ -108,7 +108,7 @@ Item {
text: qsTr("Abort")
onClicked: {
stackView.pop();
stackView.pop();
}
anchors {

View File

@ -1,24 +1,20 @@
include(FetchContent)
FetchContent_Populate(
QArchive
GIT_REPOSITORY https://github.com/antony-jr/QArchive.git
GIT_TAG e587f30507c0e6d92f79a2dc1a6aa7ebb1f8e679
# Workaround because:
# 1. QtCreator cannot handle QML_ELEMENT stuff when it is in bin folder
# https://bugreports.qt.io/browse/QTCREATORBUG-27083
SOURCE_DIR ${THIRD_PARTY_PATH}/QArchive
)
#lol
QArchive
GIT_REPOSITORY https://github.com/antony-jr/QArchive.git
GIT_TAG e587f30507c0e6d92f79a2dc1a6aa7ebb1f8e679
# Workaround because: 1. QtCreator cannot handle QML_ELEMENT stuff when it is in bin folder
# https://bugreports.qt.io/browse/QTCREATORBUG-27083
SOURCE_DIR ${THIRD_PARTY_PATH}/QArchive)
FetchContent_Populate(
qml-plausible
GIT_REPOSITORY https://gitlab.com/kelteseth/qml-plausible.git
GIT_TAG 5069ba3bf25663ea06be8b94c398d6c61058d4d5
# Workaround because:
# 1. QtCreator cannot handle QML_ELEMENT stuff when it is in bin folder
# https://bugreports.qt.io/browse/QTCREATORBUG-27083
SOURCE_DIR ${THIRD_PARTY_PATH}/qml-plausible
)
qml-plausible
GIT_REPOSITORY https://gitlab.com/kelteseth/qml-plausible.git
GIT_TAG 5069ba3bf25663ea06be8b94c398d6c61058d4d5
# Workaround because: 1. QtCreator cannot handle QML_ELEMENT stuff when it is in bin folder
# https://bugreports.qt.io/browse/QTCREATORBUG-27083
SOURCE_DIR ${THIRD_PARTY_PATH}/qml-plausible)
add_subdirectory(qml-plausible)
add_subdirectory(QArchive)
add_subdirectory(QArchive)