mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-18 16:32:33 +02:00
Add new common types and WizardPage
HeadlineSection for smaller headlines like h3 TextField that behaves like the Material design text field WizardPage that implements start and exit signals as well as a simple one page loader in a ScrollView Clean root id names to root everywhere Add prefix for Common includes to not mix with QQC2 TextField name to avoid collision
This commit is contained in:
parent
5a36e32fb6
commit
5aa714a165
@ -75,6 +75,10 @@
|
||||
<file>qml/Create/Wizards/ImportWebm/ImportWebmInit.qml</file>
|
||||
<file>qml/Common/Dialogs/MonitorConfiguration.qml</file>
|
||||
<file>qml/Common/Dialogs/SteamNotAvailable.qml</file>
|
||||
<file>qml/Create/Wizards/WizardPage.qml</file>
|
||||
<file>qml/Create/Wizards/CreateGifWallpaper.qml</file>
|
||||
<file>assets/startinfo/gimp.png</file>
|
||||
<file>qml/Common/TextField.qml</file>
|
||||
<file>qml/Common/HeadlineSection.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -2,7 +2,6 @@ import QtQuick 2.14
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Controls.Material 2.3
|
||||
|
||||
|
||||
/*!
|
||||
\qmltype Close Icon
|
||||
\brief A image selector with popup preview.
|
||||
|
10
ScreenPlay/qml/Common/HeadlineSection.qml
Normal file
10
ScreenPlay/qml/Common/HeadlineSection.qml
Normal file
@ -0,0 +1,10 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import ScreenPlay 1.0
|
||||
|
||||
Text {
|
||||
text: qsTr("Headline Section")
|
||||
font.pointSize: 14
|
||||
color: Material.primaryTextColor
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
@ -11,21 +11,21 @@ import ScreenPlay 1.0
|
||||
|
||||
Test
|
||||
|
||||
\image ImageSelectorPreview.png
|
||||
\image rootPreview.png
|
||||
|
||||
\section1 Setting default text and capitalization
|
||||
|
||||
Test
|
||||
|
||||
\qml
|
||||
ImageSelector {
|
||||
root {
|
||||
|
||||
}
|
||||
\endqml
|
||||
|
||||
*/
|
||||
Item {
|
||||
id: imageSelector
|
||||
id: root
|
||||
height: 70
|
||||
width: parent.width
|
||||
state: "nothingSelected"
|
||||
@ -37,10 +37,10 @@ Item {
|
||||
if (imageSource === "") {
|
||||
img.source = ""
|
||||
txtName.text = ""
|
||||
imageSelector.state = "nothingSelected"
|
||||
root.state = "nothingSelected"
|
||||
} else {
|
||||
img.source = imageSource
|
||||
imageSelector.state = "imageSelected"
|
||||
root.state = "imageSelected"
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,6 +105,7 @@ Item {
|
||||
id: txtPlaceholder
|
||||
clip: true
|
||||
font.pointSize: 12
|
||||
text: qsTr("You can set your own preview image here.")
|
||||
font.family: ScreenPlay.settings.font
|
||||
wrapMode: Text.WordWrap
|
||||
color: Material.secondaryTextColor
|
||||
|
@ -1,9 +1,7 @@
|
||||
import QtQuick 2.0
|
||||
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
enabled: true
|
||||
hoverEnabled: true
|
||||
propagateComposedEvents: false
|
||||
|
@ -9,7 +9,7 @@ import QtGraphicalEffects 1.0
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
Item {
|
||||
id: control
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
property alias radius: mask.radius
|
||||
@ -19,11 +19,11 @@ Item {
|
||||
|
||||
function trigger() {
|
||||
var wave = ripple.createObject(container, {
|
||||
"startX": control.width * .5,
|
||||
"startY": control.height * .5,
|
||||
"startX": root.width * .5,
|
||||
"startY": root.height * .5,
|
||||
"maxRadius": furthestDistance(
|
||||
control.width * .5,
|
||||
control.height * .5)
|
||||
root.width * .5,
|
||||
root.height * .5)
|
||||
})
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ Item {
|
||||
id: ink
|
||||
radius: 0
|
||||
opacity: 0.25
|
||||
color: control.color
|
||||
color: root.color
|
||||
property int startX
|
||||
property int startY
|
||||
property int maxRadius: 150
|
||||
@ -80,7 +80,7 @@ Item {
|
||||
property: "opacity"
|
||||
from: 0.8
|
||||
to: 0
|
||||
duration: control.duration
|
||||
duration: root.duration
|
||||
}
|
||||
ScriptAction {
|
||||
script: ink.destroy()
|
||||
|
@ -4,7 +4,10 @@ import QtQuick.Controls.Material 2.0
|
||||
|
||||
import ScreenPlay 1.0
|
||||
|
||||
import "../Common" as Common
|
||||
|
||||
Item {
|
||||
id:root
|
||||
width: 300
|
||||
|
||||
ToolButton {
|
||||
@ -20,13 +23,10 @@ Item {
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: txtSearch
|
||||
width: 250
|
||||
height: 40
|
||||
font.family: ScreenPlay.settings.font
|
||||
leftPadding: 10
|
||||
color: Material.secondaryTextColor
|
||||
anchors {
|
||||
right: icnSearch.left
|
||||
rightMargin: 10
|
||||
@ -40,8 +40,6 @@ Item {
|
||||
ScreenPlay.installedListFilter.sortByName(txtSearch.text)
|
||||
}
|
||||
}
|
||||
|
||||
selectByMouse: true
|
||||
placeholderText: qsTr("Search for Wallpaper & Widgets")
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import QtQuick.Controls 2.2 as QQC
|
||||
import ScreenPlay 1.0
|
||||
|
||||
Item {
|
||||
id: sliderVolumeWrapperBottom
|
||||
id: root
|
||||
height: 70
|
||||
|
||||
property string headline: "dummyHeandline"
|
||||
|
@ -17,20 +17,18 @@ Item {
|
||||
anchors.fill: parent
|
||||
radius: 3
|
||||
color: Material.theme === Material.Light ? Qt.lighter(
|
||||
Material.background) : Material.background
|
||||
Material.background) : Material.background
|
||||
|
||||
Text {
|
||||
id: txt
|
||||
text: _name
|
||||
color: Material.theme === Material.Light ? Qt.lighter(
|
||||
Material.foreground) : Qt.darker(
|
||||
Material.foreground)
|
||||
|
||||
color: Material.primaryTextColor
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
anchors.fill: parent
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: textField
|
||||
enabled: false
|
||||
|
@ -2,13 +2,15 @@ import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
import ScreenPlay 1.0
|
||||
|
||||
Item {
|
||||
id: tagSelector
|
||||
id: root
|
||||
height: 70
|
||||
implicitWidth: 200
|
||||
onStateChanged: {
|
||||
if (tagSelector.state === "add") {
|
||||
if (root.state === "add") {
|
||||
btnAdd.text = qsTr("Save")
|
||||
textField.focus = true
|
||||
} else {
|
||||
@ -16,9 +18,9 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
function getTags(){
|
||||
var array = [];
|
||||
for(var i = 0; i < listModel.count; i++) {
|
||||
function getTags() {
|
||||
var array = []
|
||||
for (var i = 0; i < listModel.count; i++) {
|
||||
array.push(listModel.get(i)._name)
|
||||
}
|
||||
return array
|
||||
@ -26,7 +28,8 @@ Item {
|
||||
|
||||
Rectangle {
|
||||
id: 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
|
||||
anchors {
|
||||
@ -72,7 +75,10 @@ Item {
|
||||
radius: 3
|
||||
height: parent.height - 20
|
||||
width: 200
|
||||
color: Material.theme === Material.Light ? Qt.lighter(Material.background) : Material.background
|
||||
color: Material.theme
|
||||
=== Material.Light ? Qt.lighter(
|
||||
Material.background) : Material.background
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: -80
|
||||
@ -92,12 +98,16 @@ Item {
|
||||
|
||||
TextField {
|
||||
id: textField
|
||||
anchors.fill: parent
|
||||
anchors.rightMargin: 15
|
||||
font.family: ScreenPlay.settings.font
|
||||
anchors.leftMargin: 15
|
||||
color: Material.primaryTextColor
|
||||
anchors {
|
||||
fill: parent
|
||||
rightMargin: 15
|
||||
leftMargin: 15
|
||||
}
|
||||
|
||||
onTextChanged: {
|
||||
if(textField.length >= 10){
|
||||
if (textField.length >= 10) {
|
||||
textField.text = textField.text
|
||||
}
|
||||
}
|
||||
@ -108,6 +118,7 @@ Item {
|
||||
id: btnCancel
|
||||
text: qsTr("Cancel")
|
||||
opacity: 0
|
||||
height: parent.height - 20
|
||||
enabled: false
|
||||
Material.background: Material.Red
|
||||
Material.foreground: "white"
|
||||
@ -119,13 +130,14 @@ Item {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
tagSelector.state = ""
|
||||
root.state = ""
|
||||
textField.clear()
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: btnAdd
|
||||
text: qsTr("Add Tag")
|
||||
height: parent.height - 20
|
||||
Material.background: Material.LightGreen
|
||||
Material.foreground: "white"
|
||||
font.family: ScreenPlay.settings.font
|
||||
@ -136,14 +148,14 @@ Item {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
if (tagSelector.state === "add") {
|
||||
if (root.state === "add") {
|
||||
listModel.append({
|
||||
"_name": textField.text
|
||||
})
|
||||
textField.clear()
|
||||
tagSelector.state = ""
|
||||
root.state = ""
|
||||
} else {
|
||||
tagSelector.state = "add"
|
||||
root.state = "add"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -156,7 +168,6 @@ Item {
|
||||
|
||||
PropertyChanges {
|
||||
target: textFieldWrapper
|
||||
color: "#ccffffff"
|
||||
anchors.topMargin: 10
|
||||
opacity: 1
|
||||
enabled: true
|
||||
|
147
ScreenPlay/qml/Common/TextField.qml
Normal file
147
ScreenPlay/qml/Common/TextField.qml
Normal file
@ -0,0 +1,147 @@
|
||||
import QtQuick 2.14
|
||||
import QtQuick.Window 2.14
|
||||
import QtQuick.Controls.Material 2.14
|
||||
import QtQuick.Controls 2.14 as QQC
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Layouts 1.14
|
||||
import ScreenPlay 1.0
|
||||
|
||||
Item {
|
||||
id: root
|
||||
height: 55
|
||||
width: 150
|
||||
|
||||
state: {
|
||||
if (textField.text.length > 0) {
|
||||
return "containsTextEditingFinished"
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
signal editingFinished
|
||||
|
||||
property bool dirty: false
|
||||
property alias text: textField.text
|
||||
property alias placeholderText: txtPlaceholder.text
|
||||
|
||||
Text {
|
||||
id: txtPlaceholder
|
||||
text: qsTr("Label")
|
||||
font.family: ScreenPlay.settings.font
|
||||
color: Material.primaryTextColor
|
||||
opacity: .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
|
||||
font.family: ScreenPlay.settings.font
|
||||
color: Material.secondaryTextColor
|
||||
width: parent.width
|
||||
Keys.onEscapePressed: resetState()
|
||||
onTextEdited: {
|
||||
timerSaveDelay.start()
|
||||
root.dirty = true
|
||||
}
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
|
||||
onEditingFinished: {
|
||||
resetState()
|
||||
if (textField.text.length > 0) {
|
||||
root.state = "containsTextEditingFinished"
|
||||
}
|
||||
}
|
||||
|
||||
function resetState() {
|
||||
if (textField.text.length === 0) {
|
||||
root.state = ""
|
||||
}
|
||||
textField.focus = false
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
root.state = "containsText"
|
||||
}
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -3,7 +3,7 @@ import Qt.labs.platform 1.0
|
||||
import ScreenPlay 1.0
|
||||
|
||||
SystemTrayIcon {
|
||||
id: sti
|
||||
id: root
|
||||
visible: true
|
||||
iconSource: "qrc:/assets/icons/app.ico"
|
||||
tooltip: qsTr("ScreenPlay - Double click to change you settings.")
|
||||
|
186
ScreenPlay/qml/Create/Wizards/CreateGifWallpaper.qml
Normal file
186
ScreenPlay/qml/Create/Wizards/CreateGifWallpaper.qml
Normal file
@ -0,0 +1,186 @@
|
||||
import QtQuick 2.14
|
||||
import QtQuick.Controls.Material 2.14
|
||||
import QtQuick.Controls 2.14
|
||||
import QtQuick.Layouts 1.14
|
||||
import QtQuick.Dialogs 1.2
|
||||
import ScreenPlay 1.0
|
||||
|
||||
import "../../Common" as Common
|
||||
|
||||
WizardPage {
|
||||
id: root
|
||||
|
||||
Common.Headline {
|
||||
id: txtHeadline
|
||||
text: qsTr("Create an Gif Wallpaper")
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
margins: 20
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
anchors {
|
||||
top: txtHeadline.bottom
|
||||
right: parent.right
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.preferredHeight: parent.width * .5
|
||||
Layout.preferredWidth: parent.width * .5
|
||||
|
||||
Rectangle {
|
||||
id: leftWrapper
|
||||
color: "#333333"
|
||||
radius: 3
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
|
||||
Image {
|
||||
id: imgPreview
|
||||
source: "qrc:/assets/wizards/example_html.png"
|
||||
width: parent.width
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
}
|
||||
}
|
||||
|
||||
Common.ImageSelector {
|
||||
id: imageSelector
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: 20
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: rightWrapper
|
||||
spacing: 8
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: parent.width * .5
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Text {
|
||||
text: qsTr("General")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
Common.TextField {
|
||||
id: tfTitle
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Wallpaper name")
|
||||
onTextChanged: {
|
||||
if (text.length >= 3) {
|
||||
btnSave.enabled = true
|
||||
} else {
|
||||
btnSave.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Tags")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
Common.TagSelector {
|
||||
id: tagSelector
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 10
|
||||
}
|
||||
|
||||
Row {
|
||||
height: 80
|
||||
layoutDirection: Qt.RightToLeft
|
||||
Layout.fillWidth: true
|
||||
spacing: 10
|
||||
|
||||
Button {
|
||||
id: btnSave
|
||||
text: qsTr("Save")
|
||||
enabled: false
|
||||
Material.background: Material.accent
|
||||
Material.foreground: "white"
|
||||
font.family: ScreenPlay.settings.font
|
||||
|
||||
onClicked: {
|
||||
btnSave.enabled = false
|
||||
savePopup.open()
|
||||
var tags = tagSelector.getTags()
|
||||
ScreenPlay.create.createWidget(
|
||||
ScreenPlay.globalVariables.localStoragePath,
|
||||
tfTitle.text, imageSelector.imageSource,
|
||||
tfCreatedBy.text, cbLicense.currentText,
|
||||
cbType.currentText, tags)
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ScreenPlay.create
|
||||
function onWidgetCreatedSuccessful(path) {
|
||||
ScreenPlay.util.openFolderInExplorer(path)
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: btnExit
|
||||
text: qsTr("Abort")
|
||||
font.family: ScreenPlay.settings.font
|
||||
Material.background: Material.Red
|
||||
Material.foreground: "white"
|
||||
onClicked: {
|
||||
root.wizardExited()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Popup {
|
||||
id: savePopup
|
||||
modal: true
|
||||
focus: true
|
||||
width: 250
|
||||
anchors.centerIn: parent
|
||||
height: 200
|
||||
onOpened: timerSave.start()
|
||||
|
||||
BusyIndicator {
|
||||
anchors.centerIn: parent
|
||||
running: true
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Create Widget...")
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 30
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timerSave
|
||||
interval: 1000 + Math.random() * 1000
|
||||
onTriggered: {
|
||||
savePopup.close()
|
||||
root.wizardExited()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*##^##
|
||||
Designer {
|
||||
D{i:0;autoSize:true;height:580;width:1200}
|
||||
}
|
||||
##^##*/
|
||||
|
@ -7,291 +7,174 @@ import QtQuick.Layouts 1.12
|
||||
import ScreenPlay 1.0
|
||||
import ScreenPlay.Create 1.0
|
||||
|
||||
import "../../Common"
|
||||
import "../../Common" as Common
|
||||
|
||||
Item {
|
||||
WizardPage {
|
||||
id: root
|
||||
|
||||
signal wizardStarted
|
||||
signal wizardExited
|
||||
|
||||
SwipeView {
|
||||
id: swipeView
|
||||
anchors.fill: parent
|
||||
interactive: false
|
||||
clip: true
|
||||
sourceComponent: Item {
|
||||
|
||||
Item {
|
||||
Item {
|
||||
width: parent.width * .66
|
||||
width: parent.width * .5
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
Image {
|
||||
source: "qrc:/assets/images/undraw_static_website_0107.svg"
|
||||
anchors {
|
||||
top: parent.top
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
Image {
|
||||
source: "qrc:/assets/images/undraw_static_website_0107.svg"
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
}
|
||||
width: parent.width
|
||||
height: 300
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
width: parent.width
|
||||
height: 400
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
}
|
||||
Item {
|
||||
width: parent.width * .5
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width * .33
|
||||
ColumnLayout {
|
||||
id: rightWrapper
|
||||
spacing: 8
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
Common.Headline {
|
||||
text: qsTr("Create a html Wallpaper")
|
||||
}
|
||||
|
||||
Text {
|
||||
id: txtDescription
|
||||
text: qsTr("This wizard lets you create a empty html based wallpaper. You can put anything you can imagine into this html file. For example this can be a three.js scene or a utility application written in javascript.")
|
||||
color: "gray"
|
||||
width: parent.width - 40
|
||||
font.pointSize: 13
|
||||
text: qsTr("General")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
anchors {
|
||||
centerIn: parent
|
||||
}
|
||||
Common.TextField {
|
||||
id: tfTitle
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Wallpaper name")
|
||||
onTextChanged: {
|
||||
if (text.length >= 3) {
|
||||
btnSave.enabled = true
|
||||
} else {
|
||||
btnSave.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
Common.TextField {
|
||||
id: tfCreatedBy
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Copyright owner")
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("License")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
ComboBox {
|
||||
id: cbLicense
|
||||
Layout.fillWidth: true
|
||||
font.family: ScreenPlay.settings.font
|
||||
model: ListModel {
|
||||
id: modelLicense
|
||||
ListElement {
|
||||
text: "All rights "
|
||||
}
|
||||
ListElement {
|
||||
text: "Open Source - GPLv3"
|
||||
}
|
||||
ListElement {
|
||||
text: "Open Source - MIT/Apache2"
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Tags")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
Common.TagSelector {
|
||||
id: tagSelector
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Preview Image")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
Common.ImageSelector {
|
||||
id: previewSelector
|
||||
placeHolderText: qsTr("You can set your own preview image here!")
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
Row {
|
||||
height: 80
|
||||
|
||||
anchors {
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
rightMargin: 20
|
||||
}
|
||||
|
||||
spacing: 10
|
||||
|
||||
Connections {
|
||||
target: ScreenPlay.create
|
||||
function onHtmlWallpaperCreatedSuccessful(path) {
|
||||
ScreenPlay.util.openFolderInExplorer(path)
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: qsTr("Next")
|
||||
highlighted: true
|
||||
anchors {
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
id: btnExit
|
||||
text: qsTr("Abort")
|
||||
Material.background: Material.Red
|
||||
Material.foreground: "white"
|
||||
font.family: ScreenPlay.settings.font
|
||||
onClicked: {
|
||||
root.wizardStarted()
|
||||
swipeView.incrementCurrentIndex()
|
||||
root.decrementCurrentIndex()
|
||||
root.wizardExited()
|
||||
}
|
||||
}
|
||||
}
|
||||
Item {
|
||||
|
||||
Item {
|
||||
width: parent.width * .5
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
Image {
|
||||
source: "qrc:/assets/images/undraw_static_website_0107.svg"
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
}
|
||||
width: parent.width
|
||||
height: 400
|
||||
fillMode: Image.PreserveAspectFit
|
||||
Button {
|
||||
id: btnSave
|
||||
text: qsTr("Save")
|
||||
enabled: false
|
||||
Material.background: Material.accent
|
||||
Material.foreground: "white"
|
||||
font.family: ScreenPlay.settings.font
|
||||
onClicked: {
|
||||
btnSave.enabled = false
|
||||
savePopup.open()
|
||||
var tags = tagSelector.getTags()
|
||||
ScreenPlay.create.createHTMLWallpaper(
|
||||
ScreenPlay.globalVariables.localStoragePath,
|
||||
tfTitle.text, previewSelector.imageSource,
|
||||
cbLicense.currentText, tags)
|
||||
}
|
||||
}
|
||||
Item {
|
||||
width: parent.width * .5
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: rightWrapper
|
||||
spacing: 8
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
Headline {
|
||||
text: qsTr("Create a html Wallpaper")
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("General")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
TextField {
|
||||
id: tfTitle
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Wallpaper name")
|
||||
font.family: ScreenPlay.settings.font
|
||||
onTextChanged: {
|
||||
if (text.length >= 3) {
|
||||
btnSave.enabled = true
|
||||
} else {
|
||||
btnSave.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
TextField {
|
||||
id: tfCreatedBy
|
||||
font.family: ScreenPlay.settings.font
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Copyright owner")
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("License")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
ComboBox {
|
||||
id: cbLicense
|
||||
Layout.fillWidth: true
|
||||
font.family: ScreenPlay.settings.font
|
||||
model: ListModel {
|
||||
id: modelLicense
|
||||
ListElement {
|
||||
text: "All rights "
|
||||
}
|
||||
ListElement {
|
||||
text: "Open Source - GPLv3"
|
||||
}
|
||||
ListElement {
|
||||
text: "Open Source - MIT/Apache2"
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Tags")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
TagSelector {
|
||||
id: tagSelector
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Preview Image")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
ImageSelector {
|
||||
id: previewSelector
|
||||
placeHolderText: qsTr("You can set your own preview image here!")
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
Row {
|
||||
height: 80
|
||||
|
||||
anchors {
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
rightMargin: 20
|
||||
}
|
||||
|
||||
spacing: 10
|
||||
|
||||
Connections {
|
||||
target: ScreenPlay.create
|
||||
function onHtmlWallpaperCreatedSuccessful(path) {
|
||||
ScreenPlay.util.openFolderInExplorer(path)
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: btnExit
|
||||
text: qsTr("Abort")
|
||||
Material.background: Material.Red
|
||||
Material.foreground: "white"
|
||||
font.family: ScreenPlay.settings.font
|
||||
onClicked: {
|
||||
swipeView.decrementCurrentIndex()
|
||||
root.wizardExited()
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: btnSave
|
||||
text: qsTr("Save")
|
||||
enabled: false
|
||||
Material.background: Material.accent
|
||||
Material.foreground: "white"
|
||||
font.family: ScreenPlay.settings.font
|
||||
onClicked: {
|
||||
btnSave.enabled = false
|
||||
savePopup.open()
|
||||
var tags = tagSelector.getTags()
|
||||
ScreenPlay.create.createHTMLWallpaper(
|
||||
ScreenPlay.globalVariables.localStoragePath,
|
||||
tfTitle.text, previewSelector.imageSource,
|
||||
cbLicense.currentText, tags)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Popup {
|
||||
id: savePopup
|
||||
modal: true
|
||||
focus: true
|
||||
width: 250
|
||||
anchors.centerIn: parent
|
||||
height: 200
|
||||
onOpened: timerSave.start()
|
||||
|
||||
BusyIndicator {
|
||||
anchors.centerIn: parent
|
||||
running: true
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Create Html Wallpaper...")
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 30
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timerSave
|
||||
interval: 1000 + Math.random() * 1000
|
||||
onTriggered: {
|
||||
savePopup.close()
|
||||
root.wizardExited()
|
||||
}
|
||||
}
|
||||
}
|
||||
PageIndicator {
|
||||
id: indicator
|
||||
|
||||
count: swipeView.count
|
||||
currentIndex: swipeView.currentIndex
|
||||
|
||||
anchors {
|
||||
bottom: swipeView.bottom
|
||||
bottomMargin: 20
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*##^##
|
||||
Designer {
|
||||
D{i:0;autoSize:true;height:480;width:640}
|
||||
|
@ -5,15 +5,12 @@ import QtQuick.Layouts 1.14
|
||||
import QtQuick.Dialogs 1.2
|
||||
import ScreenPlay 1.0
|
||||
|
||||
import "../../Common"
|
||||
import "../../Common" as Common
|
||||
|
||||
Item {
|
||||
WizardPage {
|
||||
id: root
|
||||
function cleanup() {}
|
||||
|
||||
signal wizardStarted
|
||||
signal wizardExited
|
||||
Headline {
|
||||
Common.Headline {
|
||||
id: txtHeadline
|
||||
text: qsTr("Create an empty HTML widget")
|
||||
anchors {
|
||||
@ -50,7 +47,7 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
ImageSelector {
|
||||
Common.ImageSelector {
|
||||
id: imageSelector
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
@ -72,11 +69,10 @@ Item {
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: tfTitle
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Widget name")
|
||||
font.family: ScreenPlay.settings.font
|
||||
onTextChanged: {
|
||||
if (text.length >= 3) {
|
||||
btnSave.enabled = true
|
||||
@ -85,11 +81,10 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: tfCreatedBy
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Copyright owner")
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
Text {
|
||||
@ -122,7 +117,7 @@ Item {
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
TagSelector {
|
||||
Common.TagSelector {
|
||||
id: tagSelector
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
@ -7,205 +7,108 @@ import QtQuick.Layouts 1.12
|
||||
import ScreenPlay 1.0
|
||||
import ScreenPlay.Create 1.0
|
||||
|
||||
import "../../Common"
|
||||
import "../../Common" as Common
|
||||
|
||||
Item {
|
||||
WizardPage {
|
||||
id: root
|
||||
sourceComponent: Item {
|
||||
|
||||
signal wizardStarted
|
||||
signal wizardExited
|
||||
ColumnLayout {
|
||||
id: rightWrapper
|
||||
spacing: 10
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
SwipeView {
|
||||
id: swipeView
|
||||
anchors.fill: parent
|
||||
interactive: false
|
||||
clip: true
|
||||
Common.Headline {
|
||||
text: qsTr("Create a QML Wallpaper")
|
||||
}
|
||||
|
||||
Item {
|
||||
Item {
|
||||
width: parent.width * .66
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
Image {
|
||||
source: "qrc:/assets/images/undraw_static_website_0107.svg"
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
Common.HeadlineSection {
|
||||
text: qsTr("General")
|
||||
}
|
||||
RowLayout {
|
||||
spacing: 20
|
||||
|
||||
Common.TextField {
|
||||
id: tfTitle
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Wallpaper name")
|
||||
onTextChanged: {
|
||||
if (text.length >= 3) {
|
||||
btnSave.enabled = true
|
||||
} else {
|
||||
btnSave.enabled = false
|
||||
}
|
||||
}
|
||||
width: parent.width
|
||||
height: 300
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
Common.TextField {
|
||||
id: tfCreatedBy
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Copyright owner")
|
||||
}
|
||||
}
|
||||
Common.TextField {
|
||||
id: tfDescription
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Description")
|
||||
}
|
||||
|
||||
Item {
|
||||
width: parent.width * .33
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
height: 30
|
||||
}
|
||||
|
||||
Text {
|
||||
id: txtDescription
|
||||
text: qsTr("This wizard lets you create a empty html based wallpaper. You can put anything you can imagine into this html file. For example this can be a three.js scene or a utility application written in javascript.")
|
||||
color: "gray"
|
||||
width: parent.width - 40
|
||||
font.pointSize: 13
|
||||
Common.HeadlineSection {
|
||||
text: qsTr("License & Tags")
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: 20
|
||||
|
||||
ComboBox {
|
||||
id: cbLicense
|
||||
Layout.fillWidth: true
|
||||
font.family: ScreenPlay.settings.font
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
anchors {
|
||||
centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: qsTr("Next")
|
||||
highlighted: true
|
||||
anchors {
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
font.family: ScreenPlay.settings.font
|
||||
onClicked: {
|
||||
root.wizardStarted()
|
||||
swipeView.incrementCurrentIndex()
|
||||
}
|
||||
}
|
||||
}
|
||||
Item {
|
||||
|
||||
Item {
|
||||
width: parent.width * .5
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
Image {
|
||||
source: "qrc:/assets/images/undraw_static_website_0107.svg"
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
}
|
||||
width: parent.width
|
||||
height: 400
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
}
|
||||
Item {
|
||||
width: parent.width * .5
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: 20
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: rightWrapper
|
||||
spacing: 8
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
Headline {
|
||||
text: qsTr("Create a html Wallpaper")
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("General")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
TextField {
|
||||
id: tfTitle
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Wallpaper name")
|
||||
font.family: ScreenPlay.settings.font
|
||||
onTextChanged: {
|
||||
if (text.length >= 3) {
|
||||
btnSave.enabled = true
|
||||
} else {
|
||||
btnSave.enabled = false
|
||||
}
|
||||
model: ListModel {
|
||||
id: modelLicense
|
||||
ListElement {
|
||||
text: "Copyright by me"
|
||||
}
|
||||
ListElement {
|
||||
text: "Open Source - GPLv3"
|
||||
}
|
||||
ListElement {
|
||||
text: "Open Source - MIT/Apache2"
|
||||
}
|
||||
}
|
||||
TextField {
|
||||
id: tfCreatedBy
|
||||
font.family: ScreenPlay.settings.font
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Copyright owner")
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("License")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
ComboBox {
|
||||
id: cbLicense
|
||||
Layout.fillWidth: true
|
||||
font.family: ScreenPlay.settings.font
|
||||
model: ListModel {
|
||||
id: modelLicense
|
||||
ListElement {
|
||||
text: "All rights "
|
||||
}
|
||||
ListElement {
|
||||
text: "Open Source - GPLv3"
|
||||
}
|
||||
ListElement {
|
||||
text: "Open Source - MIT/Apache2"
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Tags")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
TagSelector {
|
||||
id: tagSelector
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Preview Image")
|
||||
font.pointSize: 14
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
ImageSelector {
|
||||
id: previewSelector
|
||||
placeHolderText: qsTr("You can set your own preview image here!")
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Common.TagSelector {
|
||||
id: tagSelector
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
Row {
|
||||
height: 80
|
||||
|
||||
anchors {
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
rightMargin: 20
|
||||
}
|
||||
Item {
|
||||
height: 30
|
||||
}
|
||||
|
||||
Common.HeadlineSection {
|
||||
text: qsTr("Preview Image")
|
||||
}
|
||||
|
||||
Common.ImageSelector {
|
||||
id: previewSelector
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Item {
|
||||
height: 30
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: 10
|
||||
|
||||
Connections {
|
||||
@ -214,15 +117,19 @@ Item {
|
||||
ScreenPlay.util.openFolderInExplorer(path)
|
||||
}
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Button {
|
||||
id: btnExit
|
||||
text: qsTr("Abort")
|
||||
Material.background: Material.Red
|
||||
Material.foreground: "white"
|
||||
Layout.alignment: Qt.AlignRight
|
||||
font.family: ScreenPlay.settings.font
|
||||
onClicked: {
|
||||
swipeView.decrementCurrentIndex()
|
||||
root.decrementCurrentIndex()
|
||||
root.wizardExited()
|
||||
}
|
||||
}
|
||||
@ -233,12 +140,13 @@ Item {
|
||||
enabled: false
|
||||
Material.background: Material.accent
|
||||
Material.foreground: "white"
|
||||
Layout.alignment: Qt.AlignRight
|
||||
font.family: ScreenPlay.settings.font
|
||||
onClicked: {
|
||||
btnSave.enabled = false
|
||||
savePopup.open()
|
||||
var tags = tagSelector.getTags()
|
||||
ScreenPlay.create.createHTMLWallpaper(
|
||||
ScreenPlay.create.createQMLWallpaper(
|
||||
ScreenPlay.globalVariables.localStoragePath,
|
||||
tfTitle.text, previewSelector.imageSource,
|
||||
cbLicense.currentText, tags)
|
||||
@ -247,51 +155,7 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Popup {
|
||||
id: savePopup
|
||||
modal: true
|
||||
focus: true
|
||||
width: 250
|
||||
anchors.centerIn: parent
|
||||
height: 200
|
||||
onOpened: timerSave.start()
|
||||
|
||||
BusyIndicator {
|
||||
anchors.centerIn: parent
|
||||
running: true
|
||||
}
|
||||
Text {
|
||||
text: qsTr("Create Html Wallpaper...")
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 30
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timerSave
|
||||
interval: 1000 + Math.random() * 1000
|
||||
onTriggered: {
|
||||
savePopup.close()
|
||||
root.wizardExited()
|
||||
}
|
||||
}
|
||||
}
|
||||
PageIndicator {
|
||||
id: indicator
|
||||
|
||||
count: swipeView.count
|
||||
currentIndex: swipeView.currentIndex
|
||||
|
||||
anchors {
|
||||
bottom: swipeView.bottom
|
||||
bottomMargin: 20
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*##^##
|
||||
Designer {
|
||||
D{i:0;autoSize:true;height:480;width:640}
|
||||
|
@ -5,17 +5,12 @@ import QtQuick.Layouts 1.14
|
||||
import QtQuick.Dialogs 1.2
|
||||
import ScreenPlay 1.0
|
||||
|
||||
import "../../Common" as Common
|
||||
|
||||
import "../../Common"
|
||||
|
||||
Item {
|
||||
WizardPage {
|
||||
id: root
|
||||
function cleanup() {}
|
||||
|
||||
signal wizardStarted
|
||||
signal wizardExited
|
||||
|
||||
Headline {
|
||||
Common.Headline {
|
||||
id: txtHeadline
|
||||
text: qsTr("Create an empty QML widget")
|
||||
anchors {
|
||||
@ -49,11 +44,10 @@ Item {
|
||||
source: "qrc:/assets/wizards/example_qml.png"
|
||||
width: parent.width
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ImageSelector {
|
||||
Common.ImageSelector {
|
||||
id: imageSelector
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
@ -75,11 +69,10 @@ Item {
|
||||
color: "#757575"
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: tfTitle
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Widget name")
|
||||
font.family: ScreenPlay.settings.font
|
||||
onTextChanged: {
|
||||
if (text.length >= 3) {
|
||||
btnSave.enabled = true
|
||||
@ -88,14 +81,12 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: tfCreatedBy
|
||||
Layout.fillWidth: true
|
||||
placeholderText: qsTr("Copyright owner")
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
|
||||
Text {
|
||||
text: qsTr("License")
|
||||
font.pointSize: 14
|
||||
@ -126,7 +117,7 @@ Item {
|
||||
font.family: ScreenPlay.settings.font
|
||||
}
|
||||
|
||||
TagSelector {
|
||||
Common.TagSelector {
|
||||
id: tagSelector
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
@ -181,7 +172,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Popup {
|
||||
|
@ -7,8 +7,6 @@ import QtQuick.Layouts 1.12
|
||||
import ScreenPlay 1.0
|
||||
import ScreenPlay.Create 1.0
|
||||
|
||||
import "../../../Common"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
|
@ -8,7 +8,7 @@ import QtQuick.Dialogs 1.3
|
||||
import ScreenPlay 1.0
|
||||
import ScreenPlay.Create 1.0
|
||||
|
||||
import "../../../Common"
|
||||
import "../../../Common" as Common
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@ -24,7 +24,7 @@ Item {
|
||||
margins: 20
|
||||
}
|
||||
|
||||
Headline {
|
||||
Common.Headline {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Import a video")
|
||||
|
@ -7,7 +7,7 @@ import QtQuick.Layouts 1.12
|
||||
import ScreenPlay 1.0
|
||||
import ScreenPlay.Create 1.0
|
||||
|
||||
import "../../../Common"
|
||||
import "../../../Common" as Common
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@ -216,10 +216,9 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
ImageSelector {
|
||||
Common.ImageSelector {
|
||||
id: previewSelector
|
||||
height: 80
|
||||
placeHolderText: qsTr("You can set your own preview image here!")
|
||||
anchors {
|
||||
right: parent.right
|
||||
rightMargin: 20
|
||||
@ -251,11 +250,10 @@ Item {
|
||||
bottomMargin: 50
|
||||
}
|
||||
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: textFieldName
|
||||
placeholderText: qsTr("Name (required!)")
|
||||
width: parent.width
|
||||
font.family: ScreenPlay.settings.font
|
||||
Layout.fillWidth: true
|
||||
onTextChanged: {
|
||||
if (textFieldName.text.length >= 3) {
|
||||
@ -266,26 +264,23 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: textFieldDescription
|
||||
placeholderText: qsTr("Description")
|
||||
font.family: ScreenPlay.settings.font
|
||||
width: parent.width
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: textFieldYoutubeURL
|
||||
placeholderText: qsTr("Youtube URL")
|
||||
font.family: ScreenPlay.settings.font
|
||||
width: parent.width
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
TagSelector {
|
||||
Common.TagSelector {
|
||||
id: textFieldTags
|
||||
width: parent.width
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
@ -7,8 +7,6 @@ import QtQuick.Layouts 1.12
|
||||
import ScreenPlay 1.0
|
||||
import ScreenPlay.Create 1.0
|
||||
|
||||
import "../../../Common"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
|
@ -7,7 +7,7 @@ import QtQuick.Layouts 1.12
|
||||
import ScreenPlay 1.0
|
||||
import ScreenPlay.Create 1.0
|
||||
|
||||
import "../../../Common"
|
||||
import "../../../Common" as Common
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@ -105,15 +105,9 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
Common.Headline {
|
||||
id: txtHeadline
|
||||
text: qsTr("Convert a video to a wallpaper")
|
||||
height: 40
|
||||
font.family: ScreenPlay.settings.font
|
||||
font.weight: Font.Light
|
||||
color: Material.primaryTextColor
|
||||
|
||||
font.pointSize: 23
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
@ -214,10 +208,9 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
ImageSelector {
|
||||
Common.ImageSelector {
|
||||
id: previewSelector
|
||||
height: 80
|
||||
placeHolderText: qsTr("You can set your own preview image here!")
|
||||
anchors {
|
||||
right: parent.right
|
||||
rightMargin: 20
|
||||
@ -249,11 +242,10 @@ Item {
|
||||
bottomMargin: 50
|
||||
}
|
||||
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: textFieldName
|
||||
placeholderText: qsTr("Name (required!)")
|
||||
width: parent.width
|
||||
font.family: ScreenPlay.settings.font
|
||||
Layout.fillWidth: true
|
||||
onTextChanged: {
|
||||
if (textFieldName.text.length >= 3) {
|
||||
@ -264,26 +256,23 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: textFieldDescription
|
||||
placeholderText: qsTr("Description")
|
||||
font.family: ScreenPlay.settings.font
|
||||
width: parent.width
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: textFieldYoutubeURL
|
||||
placeholderText: qsTr("Youtube URL")
|
||||
font.family: ScreenPlay.settings.font
|
||||
width: parent.width
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
TagSelector {
|
||||
Common.TagSelector {
|
||||
id: textFieldTags
|
||||
width: parent.width
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import QtQuick.Dialogs 1.3
|
||||
import ScreenPlay 1.0
|
||||
import ScreenPlay.Create 1.0
|
||||
|
||||
import "../../../Common"
|
||||
import "../../../Common" as Common
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@ -24,7 +24,7 @@ Item {
|
||||
margins: 20
|
||||
}
|
||||
|
||||
Headline {
|
||||
Common.Headline {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Import a video")
|
||||
|
77
ScreenPlay/qml/Create/Wizards/WizardPage.qml
Normal file
77
ScreenPlay/qml/Create/Wizards/WizardPage.qml
Normal file
@ -0,0 +1,77 @@
|
||||
import QtQuick 2.12
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Controls.Material 2.3
|
||||
import QtQuick.Layouts 1.12
|
||||
|
||||
import ScreenPlay 1.0
|
||||
import ScreenPlay.Create 1.0
|
||||
|
||||
FocusScope {
|
||||
id: root
|
||||
|
||||
signal wizardStarted
|
||||
signal wizardExited
|
||||
|
||||
property Component sourceComponent
|
||||
property alias savePopup: savePopup
|
||||
|
||||
ScrollView {
|
||||
anchors {
|
||||
topMargin: 20
|
||||
top:parent.top
|
||||
right:parent.right
|
||||
bottom: parent.bottom
|
||||
left:parent.left
|
||||
}
|
||||
|
||||
contentWidth: width
|
||||
contentHeight: loader.height
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
width: Math.min(parent.width, 800)
|
||||
height: item.childrenRect.height
|
||||
clip: true
|
||||
sourceComponent: root.sourceComponent
|
||||
anchors {
|
||||
top: parent.top
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Popup {
|
||||
id: savePopup
|
||||
modal: true
|
||||
focus: true
|
||||
width: 250
|
||||
height: 200
|
||||
anchors.centerIn: parent
|
||||
onOpened: timerSave.start()
|
||||
|
||||
BusyIndicator {
|
||||
anchors.centerIn: parent
|
||||
running: true
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Saving...")
|
||||
font.family: ScreenPlay.settings.font
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
bottom: parent.bottom
|
||||
bottomMargin: 30
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timerSave
|
||||
interval: 1000 + Math.random() * 1000
|
||||
onTriggered: {
|
||||
savePopup.close()
|
||||
root.wizardExited()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -10,6 +10,8 @@ import ScreenPlay 1.0
|
||||
|
||||
import "upload/"
|
||||
|
||||
import "../Common" as Common
|
||||
|
||||
Item {
|
||||
id: workshop
|
||||
state: "base"
|
||||
@ -246,7 +248,7 @@ Item {
|
||||
radius: 3
|
||||
}
|
||||
|
||||
TextField {
|
||||
Common.TextField {
|
||||
id: tiSearch
|
||||
anchors {
|
||||
top: parent.top
|
||||
@ -257,10 +259,6 @@ Item {
|
||||
leftMargin: 10
|
||||
}
|
||||
placeholderText: qsTr("Search for Wallpaper and Widgets...")
|
||||
placeholderTextColor: "#666666"
|
||||
font.pointSize: 10
|
||||
font.family: ScreenPlay.settings.font
|
||||
color: "white"
|
||||
onTextChanged: timerSearch.restart()
|
||||
Timer {
|
||||
id: timerSearch
|
||||
@ -334,9 +332,9 @@ Item {
|
||||
subscriptionCount: m_subscriptionCount
|
||||
itemIndex: index
|
||||
onClicked: {
|
||||
sidebar.setWorkshopItem(
|
||||
workshopID, imgUrl, additionalPreviewUrl,
|
||||
subscriptionCount)
|
||||
sidebar.setWorkshopItem(workshopID, imgUrl,
|
||||
additionalPreviewUrl,
|
||||
subscriptionCount)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user