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

Remove duplicates

This commit is contained in:
Elias Steurer 2022-05-05 13:01:45 +02:00
parent 484204de5f
commit 3c40138371
27 changed files with 0 additions and 2831 deletions

View File

@ -1,98 +0,0 @@
import QtQuick
import QtQuick.Controls.Material
import Qt5Compat.GraphicalEffects
import QtQuick.Particles
Rectangle {
id: element
anchors.fill: parent
color: Material.theme === Material.Light ? "white" : Qt.darker(Material.background)
state: "init"
Rectangle {
id: bgCommunity
anchors.fill: parent
}
Rectangle {
id: bgWorkshop
color: "#161C1D"
anchors.fill: parent
}
states: [
State {
name: "init"
PropertyChanges {
target: bgCommunity
opacity: 0
}
PropertyChanges {
target: bgWorkshop
opacity: 0
}
},
State {
name: "create"
PropertyChanges {
target: bgCommunity
opacity: 0
}
PropertyChanges {
target: bgWorkshop
opacity: 0
}
},
State {
name: "community"
PropertyChanges {
target: bgCommunity
opacity: 1
}
PropertyChanges {
target: bgWorkshop
opacity: 0
}
},
State {
name: "workshop"
PropertyChanges {
target: bgCommunity
opacity: 0
}
PropertyChanges {
target: bgWorkshop
opacity: 1
}
}
]
transitions: [
Transition {
from: "*"
to: "*"
PropertyAnimation {
targets: [bgCommunity, bgWorkshop]
property: "opacity"
duration: 400
easing.type: Easing.InOutQuart
}
}
]
}

View File

@ -1,84 +0,0 @@
import QtQuick
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material
/*!
\qmltype Close Icon
\brief A image selector with popup preview.
*/
MouseArea {
id: root
/*!
\qmlproperty color BackButtonIcon::color
Color if the icon.
*/
property color color: Material.iconColor
/*!
\qmlproperty string BackButtonIcon::icon
Icon image if the icon.
*/
property string icon: "qrc:/assets/icons/icon_close.svg"
width: 32
height: width
cursorShape: Qt.PointingHandCursor
onEntered: root.state = "hover"
onExited: root.state = ""
hoverEnabled: true
anchors {
top: parent.top
right: parent.right
margins: 10
}
Image {
id: imgClose
source: root.icon
visible: false
width: 14
height: 14
smooth: true
anchors.centerIn: parent
sourceSize: Qt.size(width, width)
}
ColorOverlay {
id: iconColorOverlay
anchors.fill: imgClose
source: imgClose
color: root.color
}
states: [
State {
name: "hover"
PropertyChanges {
target: iconColorOverlay
color: Material.color(Material.Orange)
}
}
]
transitions: [
Transition {
from: ""
to: "hover"
reversible: true
ColorAnimation {
target: iconColorOverlay
duration: 200
easing.type: Easing.InOutQuad
}
}
]
}

View File

@ -1,773 +0,0 @@
/*
Based on: https://github.com/albertino80/bppgrid
MIT License
Copyright (c) 2019 Alberto Bignotti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Shapes 1.12
Pane {
property color hueColor: "blue"
property int colorHandleRadius: 10
property int marginsValue: 10
property int chekerSide: 5
property color currentColor: "black"
property var commonColors: ['#FFFFFF', '#C0C0C0', '#808080', '#000000', '#FF0000', '#800000', '#FFFF00', '#808000', '#00FF00', '#008000', '#00FFFF', '#008080', '#0000FF', '#000080', '#FF00FF', '#800080']
property bool updatingControls: false
function initColor(acolor) {
initColorRGB(acolor.r * 255, acolor.g * 255, acolor.b * 255, acolor.a * 255);
}
function setHueColor(hueValue) {
var v = 1 - hueValue;
if (0 <= v && v < 0.16) {
return Qt.rgba(1, 0, v / 0.16, 1);
} else if (0.16 <= v && v < 0.33) {
return Qt.rgba(1 - (v - 0.16) / 0.17, 0, 1, 1);
} else if (0.33 <= v && v < 0.5) {
return Qt.rgba(0, ((v - 0.33) / 0.17), 1, 1);
} else if (0.5 <= v && v < 0.76) {
return Qt.rgba(0, 1, 1 - (v - 0.5) / 0.26, 1);
} else if (0.76 <= v && v < 0.85) {
return Qt.rgba((v - 0.76) / 0.09, 1, 0, 1);
} else if (0.85 <= v && v <= 1) {
return Qt.rgba(1, 1 - (v - 0.85) / 0.15, 0, 1);
} else {
console.log("Invalid hueValue [0, 1]", hueValue);
return "white";
}
}
function hexToRgb(hex) {
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(shorthandRegex, function(m, r, g, b) {
return r + r + g + g + b + b;
});
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
"r": parseInt(result[1], 16),
"g": parseInt(result[2], 16),
"b": parseInt(result[3], 16)
} : null;
}
function rgbToHex(r, g, b) {
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
}
function drawChecker(ctx, width, height) {
ctx.lineWidth = 0;
//ctx.strokeStyle = 'blue'
var numRows = Math.ceil(height / chekerSide);
var numCols = Math.ceil(width / chekerSide);
var lastWhite = false;
var lastColWhite = false;
for (var icol = 0; icol < numCols; icol++) {
lastColWhite = lastWhite;
for (var irow = 0; irow < numRows; irow++) {
if (lastWhite)
ctx.fillStyle = 'gray';
else
ctx.fillStyle = 'white';
ctx.fillRect(icol * chekerSide, irow * chekerSide, chekerSide, chekerSide);
lastWhite = !lastWhite;
}
lastWhite = !lastColWhite;
}
}
function handleMouseVertSlider(mouse, ctrlCursor, ctrlHeight) {
if (mouse.buttons & Qt.LeftButton) {
ctrlCursor.y = Math.max(0, Math.min(ctrlHeight, mouse.y));
setCurrentColor();
}
}
function setCurrentColor() {
var alphaFactor = 1 - (shpAlpha.y / shpAlpha.parent.height);
if (optHsv.checked) {
var hueFactor = 1 - (shpHue.y / shpHue.parent.height);
hueColor = setHueColor(hueFactor);
var saturation = (pickerCursor.x + colorHandleRadius) / pickerCursor.parent.width;
var colorValue = 1 - ((pickerCursor.y + colorHandleRadius) / pickerCursor.parent.height);
currentColor = Qt.hsva(hueFactor, saturation, colorValue, alphaFactor);
} else {
currentColor = Qt.rgba(sliderRed.value / 255, sliderGreen.value / 255, sliderBlue.value / 255, alphaFactor);
}
hexColor.text = rgbToHex(currentColor.r * 255, currentColor.g * 255, currentColor.b * 255);
optHsv.focus = true;
}
function initColorRGB(ared, agreen, ablue, aalpha) {
updatingControls = true;
var acolor = Qt.rgba(ared / 255, agreen / 255, ablue / 255, aalpha / 255);
var valHue = acolor.hsvHue;
if (valHue < 0)
valHue = 0;
//console.log("toset", acolor.r * 255, acolor.g * 255, acolor.b * 255, acolor.a * 255)
shpHue.y = ((1 - valHue) * shpHue.parent.height);
shpAlpha.y = ((1 - acolor.a) * shpAlpha.parent.height);
pickerCursor.x = (acolor.hsvSaturation * pickerCursor.parent.width) - colorHandleRadius;
pickerCursor.y = ((1 - acolor.hsvValue) * pickerCursor.parent.height) - colorHandleRadius;
sliderRed.value = ared;
sliderGreen.value = agreen;
sliderBlue.value = ablue;
setCurrentColor();
updatingControls = false;
}
width: 500
height: 300
Component.onCompleted: {
initColorRGB(255, 0, 0, 255);
}
RowLayout {
anchors.fill: parent
//anchors.margins: marginsValue
anchors.margins: 0
spacing: marginsValue
ColumnLayout {
Layout.fillHeight: true
Layout.fillWidth: true
spacing: marginsValue
RowLayout {
Layout.fillHeight: true
Layout.fillWidth: true
visible: optHsv.checked
spacing: marginsValue
Item {
Layout.fillHeight: true
Layout.fillWidth: true
Rectangle {
x: 0
y: 0
width: parent.width
height: parent.height
visible: true
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop {
position: 0
color: "#FFFFFF"
}
GradientStop {
position: 1
color: hueColor
}
}
}
Rectangle {
x: 0
y: 0
width: parent.width
height: parent.height
border.color: BppMetrics.accentColor
visible: true
gradient: Gradient {
GradientStop {
position: 1
color: "#FF000000"
}
GradientStop {
position: 0
color: "#00000000"
}
}
}
Rectangle {
id: pickerCursor
width: colorHandleRadius * 2
height: colorHandleRadius * 2
radius: colorHandleRadius
border.color: BppMetrics.windowBackground
border.width: 2
color: "transparent"
Rectangle {
anchors.fill: parent
anchors.margins: 2
border.color: BppMetrics.accentColor
border.width: 2
radius: width / 2
color: "transparent"
}
}
MouseArea {
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
pickerCursor.x = Math.max(-colorHandleRadius, Math.min(width, mouse.x) - colorHandleRadius);
pickerCursor.y = Math.max(-colorHandleRadius, Math.min(height, mouse.y) - colorHandleRadius);
setCurrentColor();
}
}
anchors.fill: parent
onPositionChanged: handleMouse(mouse)
onPressed: handleMouse(mouse)
}
}
Rectangle {
Layout.fillHeight: true
Layout.preferredWidth: 30
border.color: BppMetrics.accentColor
Shape {
id: shpHue
anchors.left: parent.left
anchors.margins: 0
y: 90
ShapePath {
strokeWidth: 1
strokeColor: "black"
PathSvg {
path: "M0,0 L30,0"
}
}
ShapePath {
strokeWidth: 2
strokeColor: BppMetrics.accentColor
fillColor: "transparent"
PathSvg {
path: "M0,-5 L30,-5 L30,4 L0,4z"
}
}
}
MouseArea {
anchors.fill: parent
onPositionChanged: handleMouseVertSlider(mouse, shpHue, height)
onPressed: handleMouseVertSlider(mouse, shpHue, height)
}
gradient: Gradient {
GradientStop {
position: 1
color: "#FF0000"
}
GradientStop {
position: 0.85
color: "#FFFF00"
}
GradientStop {
position: 0.76
color: "#00FF00"
}
GradientStop {
position: 0.5
color: "#00FFFF"
}
GradientStop {
position: 0.33
color: "#0000FF"
}
GradientStop {
position: 0.16
color: "#FF00FF"
}
GradientStop {
position: 0
color: "#FF0000"
}
}
}
}
ColumnLayout {
Layout.fillHeight: true
Layout.fillWidth: true
visible: optRgb.checked
Label {
text: qsTr("Red")
color: BppMetrics.textColor
}
Slider {
id: sliderRed
Layout.fillWidth: true
from: 0
to: 255
value: 0
onValueChanged: {
if (!updatingControls)
setCurrentColor();
}
}
Label {
text: qsTr("Green")
color: BppMetrics.textColor
}
Slider {
id: sliderGreen
Layout.fillWidth: true
from: 0
to: 255
value: 0
onValueChanged: {
if (!updatingControls)
setCurrentColor();
}
}
Label {
text: qsTr("Blue")
color: BppMetrics.textColor
}
Slider {
id: sliderBlue
Layout.fillWidth: true
from: 0
to: 255
value: 0
onValueChanged: {
if (!updatingControls)
setCurrentColor();
}
}
Item {
Layout.fillHeight: true
}
}
Rectangle {
Layout.fillWidth: true
Layout.minimumHeight: 25
Layout.maximumHeight: 25
border.color: BppMetrics.accentColor
RowLayout {
anchors.fill: parent
anchors.margins: 1
spacing: 0
Repeater {
model: commonColors
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
color: modelData
border.color: "gray"
border.width: 0
MouseArea {
anchors.fill: parent
hoverEnabled: true
onPressed: {
initColorRGB(parent.color.r * 255, parent.color.g * 255, parent.color.b * 255, 255);
}
onEntered: {
border.width = 1;
var compColor = Qt.rgba(1, 1, 1, 1);
if (color.hsvValue > 0.5)
compColor = Qt.rgba(0, 0, 0, 1);
border.color = compColor;
}
onExited: {
border.width = 0;
}
}
}
}
}
}
}
Canvas {
Layout.fillHeight: true
Layout.preferredWidth: 30
onPaint: {
var ctx = getContext('2d');
drawChecker(ctx, width, height);
}
Rectangle {
anchors.fill: parent
border.color: BppMetrics.accentColor
Shape {
id: shpAlpha
anchors.left: parent.left
anchors.margins: 0
y: 90
ShapePath {
strokeWidth: 1
strokeColor: "black"
PathSvg {
path: "M0,0 L30,0"
}
}
ShapePath {
strokeWidth: 2
strokeColor: BppMetrics.accentColor
fillColor: "transparent"
PathSvg {
path: "M0,-5 L30,-5 L30,4 L0,4z"
}
}
}
MouseArea {
anchors.fill: parent
onPositionChanged: handleMouseVertSlider(mouse, shpAlpha, height)
onPressed: handleMouseVertSlider(mouse, shpAlpha, height)
}
gradient: Gradient {
//GradientStop { position: 0.0; color: "#FF000000" }
GradientStop {
position: 0
color: Qt.rgba(currentColor.r, currentColor.g, currentColor.b, 1)
}
GradientStop {
position: 1
color: "#00000000"
}
}
}
}
ColumnLayout {
Layout.fillHeight: true
Layout.minimumWidth: 70
Layout.maximumWidth: 70
//spacing: 0
Canvas {
Layout.fillWidth: true
height: 35
onPaint: {
var ctx = getContext('2d');
drawChecker(ctx, width, height);
}
Rectangle {
border.color: BppMetrics.accentColor
color: "transparent"
anchors.fill: parent
RowLayout {
anchors.fill: parent
anchors.margins: 1
spacing: 0
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
color: Qt.rgba(currentColor.r, currentColor.g, currentColor.b, 1)
}
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
color: currentColor
}
}
}
}
ColumnLayout {
spacing: 0
RadioButton {
id: optRgb
padding: 0
text: qsTr("RGB")
Layout.alignment: Qt.AlignLeft
onCheckedChanged: initColorRGB(currentColor.r * 255, currentColor.g * 255, currentColor.b * 255, currentColor.a * 255)
contentItem: Text {
text: optRgb.text
color: BppMetrics.textColor
font.bold: true
leftPadding: optRgb.indicator.width + optRgb.spacing
verticalAlignment: Text.AlignVCenter
}
}
RadioButton {
id: optHsv
padding: 0
text: qsTr("HSV")
Layout.alignment: Qt.AlignLeft
checked: true
focus: true
onCheckedChanged: initColorRGB(currentColor.r * 255, currentColor.g * 255, currentColor.b * 255, currentColor.a * 255)
contentItem: Text {
text: optHsv.text
color: BppMetrics.textColor
font.bold: true
leftPadding: optHsv.indicator.width + optHsv.spacing
verticalAlignment: Text.AlignVCenter
}
}
}
Item {
Layout.fillHeight: true
}
RowLayout {
visible: optRgb.checked
Layout.fillWidth: true
Label {
text: qsTr("R:")
color: BppMetrics.textColor
}
Label {
text: Math.floor(currentColor.r * 255)
Layout.fillWidth: true
color: BppMetrics.textColor
}
}
RowLayout {
visible: optRgb.checked
Layout.fillWidth: true
Label {
text: qsTr("G:")
color: BppMetrics.textColor
}
Label {
text: Math.floor(currentColor.g * 255)
Layout.fillWidth: true
color: BppMetrics.textColor
}
}
RowLayout {
visible: optRgb.checked
Layout.fillWidth: true
Label {
text: qsTr("B:")
color: BppMetrics.textColor
}
Label {
text: Math.floor(currentColor.b * 255)
Layout.fillWidth: true
color: BppMetrics.textColor
}
}
RowLayout {
visible: optHsv.checked
Layout.fillWidth: true
Label {
text: qsTr("H:")
color: BppMetrics.textColor
}
Label {
text: Math.floor(currentColor.hsvHue * 360)
Layout.fillWidth: true
color: BppMetrics.textColor
}
}
RowLayout {
visible: optHsv.checked
Layout.fillWidth: true
Label {
text: qsTr("S:")
color: BppMetrics.textColor
}
Label {
text: Math.floor(currentColor.hsvSaturation * 100)
Layout.fillWidth: true
color: BppMetrics.textColor
}
}
RowLayout {
visible: optHsv.checked
Layout.fillWidth: true
Label {
text: qsTr("V:")
color: BppMetrics.textColor
}
Label {
text: Math.floor(currentColor.hsvValue * 100)
Layout.fillWidth: true
color: BppMetrics.textColor
}
}
Item {
Layout.fillHeight: true
}
//Label { text: qsTr("Alpha"); color: BppMetrics.textColor; font.bold: true; Layout.alignment: Qt.AlignLeft }
RowLayout {
Layout.fillWidth: true
Label {
text: qsTr("Alpha:")
color: BppMetrics.textColor
}
Label {
text: Math.floor(currentColor.a * 255)
Layout.fillWidth: true
color: BppMetrics.textColor
}
}
RowLayout {
Layout.fillWidth: true
spacing: 0
Label {
text: qsTr("#")
color: BppMetrics.textColor
}
TextInput {
id: hexColor
Layout.fillWidth: true
text: "FF0099"
inputMask: "HHHHHH"
selectByMouse: true
color: BppMetrics.textColor
onTextChanged: {
if (!hexColor.focus)
return ;
if (!updatingControls && acceptableInput) {
//console.log('updating', rgbColor.r, currentColor.r * 255, rgbColor.g, currentColor.g * 255, rgbColor.b, currentColor.b * 255)
var rgbColor = hexToRgb(text);
if (rgbColor && rgbColor.r !== Math.floor(currentColor.r * 255) && rgbColor.g !== Math.floor(currentColor.g * 255) && rgbColor.b !== Math.floor(currentColor.b * 255))
initColorRGB(rgbColor.r, rgbColor.g, rgbColor.b, currentColor.a * 255);
}
}
}
}
}
}
}

View File

@ -1,29 +0,0 @@
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

@ -1,69 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Controls.Material
import QtQuick.Window
import Qt5Compat.GraphicalEffects
import ScreenPlay 1.0
import "../" as Common
Common.Dialog {
id: root
property ApplicationWindow window
property string message
standardButtons: Dialog.Ok | Dialog.Help
onHelpRequested: {
Qt.openUrlExternally(
"https://forum.screen-play.app/category/7/troubleshooting")
}
Connections {
function onDisplayErrorPopup(msg) {
root.message = msg
root.window.show()
root.open()
}
target: ScreenPlay.screenPlayManager
}
contentItem: Item {
width: 600
height: 400
ColumnLayout {
anchors.margins: 20
anchors.fill: parent
spacing: 20
Image {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: 150
Layout.preferredHeight: 150
source: "qrc:/assets/icons/exclamation-triangle-solid.svg"
fillMode: Image.PreserveAspectFit
layer {
enabled: true
effect: ColorOverlay {
color: Material.color(Material.DeepOrange)
}
}
}
Text {
text: root.message
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: 20
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
horizontalAlignment: Text.AlignHCenter
font.family: ScreenPlay.settings.font
font.pointSize: 16
color: Material.primaryTextColor
}
}
}
}

View File

@ -1,48 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Controls.Material
import ScreenPlay 1.0
import "../" as Common
Common.Dialog {
id: root
standardButtons: Dialog.Ok
contentHeight: 250
Connections {
function onMonitorConfigurationChanged() {
root.open()
}
target: ScreenPlay.monitorListModel
}
contentItem: Item {
ColumnLayout {
anchors.margins: 20
anchors.fill: parent
spacing: 20
Image {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: 150
Layout.preferredHeight: 150
source: "qrc:/assets/icons/monitor_setup.svg"
fillMode: Image.PreserveAspectFit
}
Text {
text: qsTr("Your monitor setup changed!\n Please configure your wallpaper again.")
Layout.fillWidth: true
Layout.fillHeight: true
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
horizontalAlignment: Text.AlignHCenter
font.family: ScreenPlay.settings.font
font.pointSize: 16
color: Material.primaryTextColor
}
}
}
}

View File

@ -1,11 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "../" as Common
Common.Dialog {
id: root
standardButtons: Dialog.Ok
title: qsTr("Could not load steam integration!")
}

View File

@ -1,199 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick.Dialogs
import ScreenPlay 1.0
/*!
\qmltype Image Selector
\brief A image selector with popup preview.
Test
\image rootPreview.png
\section1 Setting default text and capitalization
Test
\qml
root {
}
\endqml
*/
Item {
id: root
property string file
property alias placeHolderText: txtPlaceholder.text
property alias fileDialog: fileDialog
height: 65
implicitWidth: 300
state: "nothingSelected"
onFileChanged: {
if (file === "") {
txtName.text = "";
root.state = "nothingSelected";
} else {
root.state = "imageSelected";
}
}
Rectangle {
id: rectangle
color: Material.theme === Material.Light ? Material.background : Qt.darker(Material.background)
radius: 3
clip: true
anchors {
fill: parent
margins: 3
}
Text {
id: txtPlaceholder
clip: true
font.pointSize: 12
font.family: ScreenPlay.settings.font
wrapMode: Text.WordWrap
color: Material.secondaryTextColor
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
anchors {
top: parent.top
left: parent.left
right: btnClear.left
bottom: parent.bottom
margins: 10
}
}
Text {
id: txtName
clip: true
font.pointSize: 12
font.family: ScreenPlay.settings.font
wrapMode: Text.WordWrap
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
color: Material.secondaryTextColor
anchors {
top: parent.top
left: parent.left
right: btnClear.left
bottom: parent.bottom
margins: 10
}
}
Button {
id: btnClear
text: qsTr("Clear")
Material.background: Material.theme === Material.Light ? Qt.lighter(Material.accent) : Qt.darker(Material.accent)
Material.foreground: "white"
onClicked: {
root.file = "";
fileDialog.file = "";
}
anchors {
top: parent.top
right: btnOpen.left
bottom: parent.bottom
margins: 5
}
}
Button {
id: btnOpen
text: qsTr("Select File")
Material.background: Material.accent
Material.foreground: "white"
font.family: ScreenPlay.settings.font
onClicked: fileDialog.open()
anchors {
top: parent.top
right: parent.right
rightMargin: 10
bottom: parent.bottom
margins: 5
}
}
FileDialog {
id: fileDialog
title: qsTr("Please choose a file")
onAccepted: {
root.file = fileDialog.currentFile ;
txtName.text = fileDialog.currentFile.toString();
}
}
}
states: [
State {
name: "imageSelected"
PropertyChanges {
target: btnClear
opacity: 1
anchors.topMargin: 5
}
PropertyChanges {
target: txtPlaceholder
opacity: 0
}
},
State {
name: "nothingSelected"
PropertyChanges {
target: btnClear
opacity: 0
anchors.topMargin: -40
}
}
]
transitions: [
Transition {
from: "imageSelected"
to: "nothingSelected"
reversible: true
PropertyAnimation {
target: btnClear
properties: "opacity, anchors.topMargin"
duration: 300
easing.type: Easing.OutQuart
}
PropertyAnimation {
target: txtPlaceholder
property: "opacity"
duration: 300
easing.type: Easing.OutQuart
}
}
]
}

View File

@ -1,55 +0,0 @@
import QtQuick
Scale {
id: root
property int offset: 0
property int loopOffset: 1000
property int loops: 1
property real cScale: 1.5
property alias centerX: root.origin.x
property alias centerY: root.origin.y
property SequentialAnimation grow
function start(offset = 0, loopOffset = 1000, scale = 1.5, loops = 1) {
root.offset = offset;
root.loopOffset = loopOffset;
root.loops = loops;
root.cScale = scale;
grow.restart();
}
grow: SequentialAnimation {
loops: root.loops
alwaysRunToEnd: true
PauseAnimation {
duration: root.offset
}
SequentialAnimation {
PropertyAnimation {
target: root
properties: "xScale,yScale"
from: 1
to: root.cScale
duration: 200
}
PropertyAnimation {
target: root
properties: "xScale,yScale"
from: root.cScale
to: 1
duration: 300
}
}
PauseAnimation {
duration: root.loopOffset
}
}
}

View File

@ -1,72 +0,0 @@
import QtQuick
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material
Rectangle {
id: root
property alias iconSource: icon.source
property string url
property alias color: overlay.color
color: Material.theme === Material.Light ? Material.background : Qt.darker(Material.background)
width: 42
height: width
radius: width
Image {
id: icon
sourceSize: Qt.size(28, 28)
anchors.centerIn: parent
visible: false
smooth: true
source: "qrc:/assets/icons/icon_info.svg"
}
ColorOverlay {
id: overlay
anchors.fill: icon
source: icon
color: Material.accent
}
MouseArea {
hoverEnabled: true
anchors.fill: parent
onClicked: Qt.openUrlExternally(url)
onEntered: root.state = "hover"
onExited: root.state = ""
cursorShape: Qt.PointingHandCursor
}
states: [
State {
name: "hover"
PropertyChanges {
target: icon
width: 34
height: 34
sourceSize: Qt.size(34, 34)
}
}
]
transitions: [
Transition {
from: ""
to: "hover"
reversible: true
PropertyAnimation {
target: icon
properties: "width,height,sourceSize"
duration: 200
easing.type: Easing.InOutQuart
}
}
]
}

View File

@ -1,34 +0,0 @@
import QtQuick
import QtQuick.Controls.Material
import ScreenPlay 1.0
Item {
id: root
property alias text: txtHeadline.text
height: 40
Text {
id: txtHeadline
font.pointSize: 18
color: Material.primaryTextColor
text: "Headline"
font.family: ScreenPlay.settings.font
}
Rectangle {
height: 2
width: parent.width
color: Material.secondaryTextColor
anchors {
right: parent.right
left: parent.left
bottom: parent.bottom
}
}
}

View File

@ -1,10 +0,0 @@
import QtQuick
import QtQuick.Controls.Material
import ScreenPlay 1.0
Text {
text: qsTr("Headline Section")
font.pointSize: 14
color: Material.primaryTextColor
font.family: ScreenPlay.settings.font
}

View File

@ -1,254 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick.Dialogs
import ScreenPlay 1.0
/*!
\qmltype Image Selector
\brief A image selector with popup preview.
Test
\image rootPreview.png
\section1 Setting default text and capitalization
Test
\qml
root {
}
\endqml
*/
Item {
id: root
property string imageSource
property alias placeHolderText: txtPlaceholder.text
height: 70
width: parent.width
state: "nothingSelected"
onImageSourceChanged: {
if (imageSource === "") {
img.source = "";
txtName.text = "";
root.state = "nothingSelected";
} else {
img.source = imageSource;
root.state = "imageSelected";
}
}
Rectangle {
id: rectangle
color: Material.theme === Material.Light ? Material.background : Qt.darker(Material.background)
radius: 3
clip: true
anchors {
fill: parent
margins: 3
}
Rectangle {
id: imgWrapper
width: 70
radius: 3
clip: true
color: Material.color(Material.Grey, Material.Shade700)
anchors {
top: parent.top
left: parent.left
bottom: parent.bottom
margins: 10
}
Image {
id: img
anchors.fill: parent
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
if (imageSource !== "")
popup.open();
}
}
}
Popup {
id: popup
width: 902
modal: true
anchors.centerIn: Overlay.overlay
height: 507
Image {
source: imageSource
anchors.fill: parent
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: popup.close()
}
}
Text {
id: txtPlaceholder
clip: true
font.pointSize: 12
font.capitalization: Font.Capitalize
text: qsTr("Set your own preview image")
font.family: ScreenPlay.settings.font
wrapMode: Text.WordWrap
color: Material.secondaryTextColor
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
anchors {
top: parent.top
left: imgWrapper.right
right: btnClear.left
bottom: parent.bottom
margins: 10
}
}
Text {
id: txtName
clip: true
font.pointSize: 12
font.family: ScreenPlay.settings.font
wrapMode: Text.WordWrap
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
color: Material.secondaryTextColor
anchors {
top: parent.top
left: imgWrapper.right
right: btnClear.left
bottom: parent.bottom
margins: 10
}
}
Button {
id: btnClear
text: qsTr("Clear")
Material.background: Material.theme === Material.Light ? Qt.lighter(Material.accent) : Qt.darker(Material.accent)
Material.foreground: "white"
onClicked: imageSource = ""
anchors {
top: parent.top
right: btnOpen.left
bottom: parent.bottom
margins: 5
}
}
Button {
id: btnOpen
text: qsTr("Select Preview Image")
Material.background: Material.accent
Material.foreground: "white"
font.family: ScreenPlay.settings.font
onClicked: fileDialog.open()
anchors {
top: parent.top
right: parent.right
rightMargin: 10
bottom: parent.bottom
margins: 5
}
}
FileDialog {
id: fileDialog
title: "Please choose a file"
nameFilters: ["Images (*.png *.jpg)"]
onAccepted: {
imageSource = fileDialog.fileUrl;
txtName.text = fileDialog.fileUrl.toString().replace(/^.*[\\\/]/, '');
}
}
}
states: [
State {
name: "imageSelected"
PropertyChanges {
target: btnClear
opacity: 1
anchors.topMargin: 5
}
PropertyChanges {
target: txtPlaceholder
opacity: 0
}
},
State {
name: "nothingSelected"
PropertyChanges {
target: btnClear
opacity: 0
anchors.topMargin: -40
}
}
]
transitions: [
Transition {
from: "imageSelected"
to: "nothingSelected"
reversible: true
PropertyAnimation {
target: btnClear
properties: "opacity, anchors.topMargin"
duration: 300
easing.type: Easing.OutQuart
}
PropertyAnimation {
target: txtPlaceholder
property: "opacity"
duration: 300
easing.type: Easing.OutQuart
}
}
]
}

View File

@ -1,106 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick.Layouts
import ScreenPlay 1.0
ColumnLayout {
id: root
property string name: licenseModel.get(cb.currentIndex).name
property string licenseFile: licenseModel.get(cb.currentIndex).licenseFile
Layout.preferredWidth: 250
HeadlineSection {
Layout.fillWidth: true
text: qsTr("License")
}
RowLayout {
Layout.fillHeight: true
Layout.fillWidth: true
spacing: 5
ComboBox {
id: cb
Layout.fillWidth: true
textRole: "name"
model: ListModel {
id: licenseModel
ListElement {
name: "Creative Commons - Attribution-ShareAlike 4.0"
description: qsTr("Share — copy and redistribute the material in any medium or format. Adapt — remix, transform, and build upon the material for any purpose, even commercially.")
tldrlegal: "https://tldrlegal.com/license/creative-commons-attribution-sharealike-4.0-international-(cc-by-sa-4.0)"
licenseFile: "License_CC_Attribution-ShareAlike_4.0.txt"
}
ListElement {
name: "Creative Commons - Attribution 4.0"
description: qsTr("You grant other to remix your work and change the license to their liking.")
tldrlegal: "https://tldrlegal.com/license/creative-commons-attribution-4.0-international-(cc-by-4)"
licenseFile: "License_CC_Attribution_4.0.txt"
}
ListElement {
name: "Creative Commons - Attribution-NonCommercial-ShareAlike 4.0"
description: qsTr("Share — copy and redistribute the material in any medium or format. Adapt — remix, transform, and build upon the material. You are not allowed to use it commercially! ")
tldrlegal: "https://tldrlegal.com/license/creative-commons-attribution-noncommercial-sharealike-4.0-international-(cc-by-nc-sa-4.0)"
licenseFile: "License_CC_Attribution-NonCommercial-ShareAlike_4.0.txt"
}
ListElement {
name: "Creative Commons - CC0 1.0 Universal Public Domain"
description: qsTr("You allow everyone to do anything with your work.")
tldrlegal: "https://tldrlegal.com/license/creative-commons-cc0-1.0-universal"
licenseFile: "License_CC0_1.0.txt"
}
ListElement {
name: "Open Source - Apache License 2.0"
description: qsTr("You grant other to remix your work and change the license to their liking.")
tldrlegal: "https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)"
licenseFile: "License_Apache_2.0.txt"
}
ListElement {
name: "Open Source - General Public License 3.0"
description: qsTr("You grant other to remix your work but it must remain under the GPLv3. We recommend this license for all code wallpaper!")
tldrlegal: "https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)"
licenseFile: "License_GPL_3.0.txt"
}
ListElement {
name: "All rights reserved"
description: qsTr("You do not share any rights and nobody is allowed to use or remix it (Not recommended). Can also used to credit work others.")
tldrlegal: "License_All_Rights_Reserved_1.0.txt"
}
}
}
ToolButton {
icon.source: "qrc:/assets/icons/icon_help_center.svg"
icon.color: Material.iconColor
onClicked: toolTip.open()
}
ToolButton {
icon.source: "qrc:/assets/icons/icon_open_in_new.svg"
icon.color: Material.iconColor
onClicked: Qt.openUrlExternally(licenseModel.get(cb.currentIndex).tldrlegal)
}
ToolTip {
id: toolTip
text: licenseModel.get(cb.currentIndex).description
}
}
}

View File

@ -1,27 +0,0 @@
import QtQuick
import Qt5Compat.GraphicalEffects
FastBlur {
id: root
property Item sourceItem
property bool hideSource: true
source: ShaderEffectSource {
id: effectSource
sourceItem: root.sourceItem
live: false
hideSource: root.hideSource
}
radius: 64
transparentBorder: true
Rectangle {
anchors.fill: parent
opacity: 0.5
color: "black"
}
Image {
anchors.fill: parent
opacity: 0.1
source: "qrc:/assets/images/noisy-texture-3.png"
fillMode: Image.Tile
}
}

View File

@ -1,8 +0,0 @@
import QtQuick
MouseArea {
anchors.fill: parent
enabled: true
hoverEnabled: true
propagateComposedEvents: false
}

View File

@ -1,26 +0,0 @@
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

@ -1,120 +0,0 @@
/*
* Based on:
* https://github.com/rschiang/material
* (THE BSD 2-CLAUSE LICENSE)
*/
import QtQuick
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material
Item {
id: root
property alias radius: mask.radius
property color color: Material.accent
property var target
property int duration: 600
function trigger() {
var wave = ripple.createObject(container, {
"startX": root.width * 0.5,
"startY": root.height * 0.5,
"maxRadius": furthestDistance(root.width * 0.5, root.height * 0.5)
});
}
function distance(x1, y1, x2, y2) {
return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
}
function furthestDistance(x, y) {
return Math.max(distance(x, y, 0, 0), distance(x, y, width, height), distance(x, y, 0, height), distance(x, y, width, 0));
}
anchors.fill: parent
Rectangle {
id: mask
anchors.fill: parent
color: "black"
visible: false
}
Item {
id: container
anchors.fill: parent
visible: false
}
OpacityMask {
anchors.fill: parent
source: container
maskSource: mask
}
Component {
id: ripple
Rectangle {
id: ink
property int startX
property int startY
property int maxRadius: 150
function fadeIfApplicable() {
if (!fadeAnimation.running)
fadeAnimation.start();
}
radius: 0
opacity: 0.25
color: root.color
x: startX - radius
y: startY - radius
width: radius * 2
height: radius * 2
Component.onCompleted: {
growAnimation.start();
if (!fadeAnimation.running)
fadeAnimation.start();
}
NumberAnimation {
id: growAnimation
target: ink
property: "radius"
from: 0
to: maxRadius
duration: 550
easing.type: Easing.OutCubic
}
SequentialAnimation {
id: fadeAnimation
NumberAnimation {
target: ink
property: "opacity"
from: 0.8
to: 0
duration: root.duration
}
ScriptAction {
script: ink.destroy()
}
}
}
}
}

View File

@ -1,51 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material 2.0
import ScreenPlay 1.0
Item {
id: root
width: 300
ToolButton {
id: icnSearch
icon.source: "qrc:/assets/icons/icon_search.svg"
height: 30
width: 30
icon.width: 30
icon.height: 30
icon.color: Material.iconColor
anchors {
right: parent.right
verticalCenter: parent.verticalCenter
}
}
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)
ScreenPlay.installedListFilter.resetFilter();
else
ScreenPlay.installedListFilter.sortByName(txtSearch.text);
}
anchors {
right: icnSearch.left
rightMargin: 10
top: parent.top
topMargin: 10
}
}
}

View File

@ -1,87 +0,0 @@
import QtQuick
Translate {
id: root
property int offset: 0
property int loops: 3
property int loopOffset: 1000
property SequentialAnimation shake
function start(offset = 0, loopOffset = 1000, loops = 1) {
root.offset = offset;
root.loopOffset = loopOffset;
root.loops = loops;
shake.restart();
}
shake: SequentialAnimation {
loops: root.loops
alwaysRunToEnd: true
PauseAnimation {
duration: root.offset
}
SequentialAnimation {
PropertyAnimation {
target: root
property: "x"
from: 0
to: 10
duration: 50
easing.type: Easing.InOutBounce
}
PropertyAnimation {
target: root
property: "x"
from: 10
to: -10
duration: 100
easing.type: Easing.InOutBounce
}
PropertyAnimation {
target: root
property: "x"
from: -10
to: 0
duration: 50
}
PropertyAnimation {
target: root
property: "x"
from: 0
to: 10
duration: 50
easing.type: Easing.InOutBounce
}
PropertyAnimation {
target: root
property: "x"
from: 10
to: -10
duration: 100
easing.type: Easing.InOutBounce
}
PropertyAnimation {
target: root
property: "x"
from: -10
to: 0
duration: 50
}
}
PauseAnimation {
duration: root.loopOffset
}
}
}

View File

@ -1,77 +0,0 @@
import QtQuick
import QtQuick.Controls.Material 2.0 as QQCM
import QtQuick.Layouts
import QtQuick.Controls as QQC
import ScreenPlay 1.0
Item {
id: root
property string headline: "dummyHeandline"
property string iconSource: "qrc:/assets/icons/icon_volume.svg"
property alias slider: slider
height: 70
Text {
id: txtHeadline
text: headline
height: 20
font.pointSize: 14
font.family: ScreenPlay.settings.font
color: QQCM.Material.primaryTextColor
anchors {
top: parent.top
right: parent.right
left: parent.left
}
}
RowLayout {
spacing: 30
anchors {
top: txtHeadline.bottom
right: parent.right
bottom: parent.bottom
left: parent.left
}
Image {
id: imgIcon
width: 20
height: 20
source: iconSource
sourceSize: Qt.size(20, 20)
Layout.alignment: Qt.AlignVCenter
}
QQC.Slider {
id: slider
stepSize: 0.01
from: 0
value: 1
to: 1
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
}
Text {
id: txtValue
color: QQCM.Material.secondaryTextColor
text: Math.round(slider.value * 100) / 100
Layout.alignment: Qt.AlignVCenter
font.pointSize: 12
font.italic: true
verticalAlignment: Text.AlignVCenter
}
}
}

View File

@ -1,98 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
import ScreenPlay 1.0
Item {
id: tag
property int itemIndex
property alias text: txt.text
signal removeThis(var index)
width: textMetrics.width + 20
height: 45
Rectangle {
id: rectangle
anchors.fill: parent
radius: 3
color: Material.theme === Material.Light ? Qt.lighter(Material.background) : Material.background
Text {
id: txt
text: _name
color: Material.primaryTextColor
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
anchors.fill: parent
font.family: ScreenPlay.settings.font
}
TextField {
id: textField
enabled: false
opacity: 0
anchors.fill: parent
anchors.margins: 10
anchors.bottomMargin: 0
font.family: ScreenPlay.settings.font
}
TextMetrics {
id: textMetrics
text: txt.text
font.pointSize: 14
font.family: ScreenPlay.settings.font
}
}
MouseArea {
id: ma
width: 10
height: width
cursorShape: Qt.PointingHandCursor
onClicked: {
tag.removeThis(itemIndex);
}
anchors {
top: parent.top
right: parent.right
margins: 5
}
Image {
id: name
anchors.fill: parent
source: "qrc:/assets/icons/icon_close.svg"
}
}
states: [
State {
name: "edit"
PropertyChanges {
target: txt
opacity: 0
}
PropertyChanges {
target: textField
opacity: 1
enabled: true
}
}
]
}

View File

@ -1,207 +0,0 @@
import QtQuick
import QtQuick.Controls
import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material
import ScreenPlay 1.0
Item {
id: root
function getTags() {
var array = []
for (var i = 0; i < listModel.count; i++) {
array.push(listModel.get(i)._name)
}
return array
}
height: 70
implicitWidth: 200
onStateChanged: {
if (root.state === "add") {
btnAdd.text = qsTr("Save")
textField.focus = true
} else {
btnAdd.text = qsTr("Add tag")
}
}
Rectangle {
id: rectangle
color: Material.theme === Material.Light ? Material.background : Qt.darker(
Material.background)
radius: 3
clip: true
anchors {
fill: parent
margins: 3
}
ListView {
orientation: ListView.Horizontal
model: listModel
spacing: 10
anchors {
top: parent.top
right: btnAdd.left
bottom: parent.bottom
left: parent.left
margins: 10
}
delegate: Tag {
id: delegate
text: _name
itemIndex: index
Connections {
function onRemoveThis() {
listModel.remove(itemIndex)
}
target: delegate
}
}
}
ListModel {
id: listModel
onCountChanged: getTags()
}
Rectangle {
id: textFieldWrapper
opacity: 0
enabled: false
radius: 3
height: parent.height - 20
width: 200
color: Material.theme
=== Material.Light ? Qt.lighter(
Material.background) : Material.background
anchors {
top: parent.top
topMargin: -80
right: btnCancel.left
margins: 10
}
Gradient {
GradientStop {
position: 0
color: "#00000000"
}
GradientStop {
position: 1
color: "#FF000000"
}
}
TextField {
id: textField
font.family: ScreenPlay.settings.font
color: Material.primaryTextColor
onTextChanged: {
if (textField.length >= 10)
textField.text = textField.text
}
anchors {
fill: parent
rightMargin: 15
leftMargin: 15
}
}
}
Button {
id: btnCancel
text: qsTr("Cancel")
opacity: 0
height: parent.height - 20
enabled: false
Material.accent: Material.color(Material.Red)
highlighted: true
font.family: ScreenPlay.settings.font
onClicked: {
root.state = ""
textField.clear()
}
anchors {
right: btnAdd.left
rightMargin: 10
verticalCenter: parent.verticalCenter
}
}
Button {
id: btnAdd
text: qsTr("Add Tag")
height: parent.height - 20
Material.accent: Material.color(Material.LightGreen)
highlighted: true
font.family: ScreenPlay.settings.font
onClicked: {
if (root.state === "add") {
listModel.append({
"_name": textField.text
})
textField.clear()
root.state = ""
} else {
root.state = "add"
}
}
anchors {
right: parent.right
rightMargin: 10
verticalCenter: parent.verticalCenter
}
}
}
states: [
State {
name: "add"
PropertyChanges {
target: textFieldWrapper
anchors.topMargin: 10
opacity: 1
enabled: true
}
PropertyChanges {
target: btnCancel
opacity: 1
enabled: true
}
}
]
transitions: [
Transition {
from: ""
to: "add"
reversible: true
NumberAnimation {
properties: "anchors.topMargin, opacity"
duration: 200
easing.type: Easing.OutQuart
}
}
]
}

View File

@ -1,179 +0,0 @@
import QtQuick
import QtQuick.Window
import QtQuick.Controls.Material
import QtQuick.Controls as QQC
import Qt5Compat.GraphicalEffects
import QtQuick.Layouts
import ScreenPlay 1.0
Item {
id: root
property bool required: false
property bool dirty: false
property alias text: textField.text
property alias placeholderText: txtPlaceholder.text
signal editingFinished()
height: 55
width: 150
state: {
if (textField.text.length > 0)
return "containsTextEditingFinished";
else
return "";
}
onEditingFinished: {
if (!root.required)
return ;
}
Text {
id: txtPlaceholder
text: qsTr("Label")
font.family: ScreenPlay.settings.font
color: Material.primaryTextColor
opacity: 0.4
font.pointSize: 11
font.weight: Font.Medium
anchors {
top: parent.top
topMargin: 15
left: parent.left
leftMargin: 10
}
}
Timer {
id: timerSaveDelay
interval: 1000
onTriggered: root.editingFinished()
}
QQC.TextField {
id: textField
function resetState() {
if (textField.text.length === 0)
root.state = "";
textField.focus = false;
}
font.family: ScreenPlay.settings.font
color: Material.secondaryTextColor
placeholderTextColor: Material.secondaryTextColor
width: parent.width
Keys.onEscapePressed: resetState()
onTextEdited: {
timerSaveDelay.start();
root.dirty = true;
}
onEditingFinished: {
resetState();
if (textField.text.length > 0)
root.state = "containsTextEditingFinished";
}
onPressed: {
root.state = "containsText";
}
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
}
Text {
id: requiredText
text: qsTr("*Required")
visible: root.required
font.family: ScreenPlay.settings.font
color: Material.secondaryTextColor
anchors {
top: textField.bottom
right: textField.right
}
}
states: [
State {
name: ""
PropertyChanges {
target: txtPlaceholder
font.pointSize: 11
color: Material.secondaryTextColor
anchors.topMargin: 15
anchors.leftMargin: 10
}
},
State {
name: "containsText"
PropertyChanges {
target: txtPlaceholder
font.pointSize: 8
opacity: 1
color: Material.accentColor
anchors.topMargin: 0
anchors.leftMargin: 0
}
},
State {
name: "containsTextEditingFinished"
PropertyChanges {
target: txtPlaceholder
font.pointSize: 8
color: Material.secondaryTextColor
opacity: 0.4
anchors.topMargin: 0
anchors.leftMargin: 0
}
}
]
transitions: [
Transition {
from: ""
to: "containsText"
reversible: true
PropertyAnimation {
target: txtPlaceholder
duration: 150
easing.type: Easing.InOutQuart
properties: "font.pointSize,anchors.topMargin,anchors.leftMargin,opacity,color"
}
},
Transition {
from: "containsText"
to: "containsTextEditingFinished"
reversible: true
PropertyAnimation {
target: txtPlaceholder
duration: 150
easing.type: Easing.OutSine
properties: "color,opacity"
}
}
]
}

View File

@ -1,84 +0,0 @@
import QtQuick
import QtQuick.Window
import Qt.labs.platform
import ScreenPlay 1.0
SystemTrayIcon {
id: root
property Window window
visible: true
icon.source: "qrc:/assets/icons/app.ico"
tooltip: qsTr("ScreenPlay - Double click to change you settings.")
onActivated: function (reason) {
switch (reason) {
case SystemTrayIcon.Unknown:
break
case SystemTrayIcon.Context:
break
case SystemTrayIcon.DoubleClick:
window.show()
break
case SystemTrayIcon.Trigger:
break
case SystemTrayIcon.MiddleClick:
break
}
}
menu: Menu {
MenuItem {
text: qsTr("Open ScreenPlay")
onTriggered: {
window.show()
}
}
MenuItem {
id: miMuteAll
property bool isMuted: true
text: qsTr("Mute all")
onTriggered: {
if (miMuteAll.isMuted) {
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")
}
}
}
MenuItem {
id: miStopAll
property bool isPlaying: false
text: qsTr("Pause all")
onTriggered: {
if (miStopAll.isPlaying) {
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")
}
}
}
MenuItem {
text: qsTr("Quit")
onTriggered: ScreenPlay.exit()
}
}
}

View File

@ -1,25 +0,0 @@
function isWallpaper(type) {
return type === InstalledType.VideoWallpaper
|| type === InstalledType.HTMLWallpaper
|| type === InstalledType.QMLWallpaper
|| type === InstalledType.GifWallpaper
|| type === InstalledType.WebsiteWallpaper
|| type === InstalledType.GodotWallpaper
}
function isWidget(type) {
return type === InstalledType.HTMLWidget || type === InstalledType.QMLWidget
}
function isScene(type) {
return type === InstalledType.HTMLWallpaper
|| type === InstalledType.QMLWallpaper
|| type === InstalledType.WebsiteWallpaper
|| type === InstalledType.GodotWallpaper
}
function isVideo(type) {
return type === InstalledType.VideoWallpaper
|| type === InstalledType.GifWallpaper
}

Binary file not shown.