From 16fe2bde4773e961ec1f95b985d60382c2235e23 Mon Sep 17 00:00:00 2001 From: kelteseth Date: Tue, 4 Dec 2018 13:25:46 +0100 Subject: [PATCH] Add shadow Fix spacing Remove debugs --- ScreenPlay/qml/Create/CreateWidget.qml | 11 +- ScreenPlay/qml/Create/CreateWidgetButton.qml | 29 +- .../CreateWallpaper/CreateWallpaperWizard.qml | 781 +++++++++--------- ScreenPlay/src/create.cpp | 3 - 4 files changed, 425 insertions(+), 399 deletions(-) diff --git a/ScreenPlay/qml/Create/CreateWidget.qml b/ScreenPlay/qml/Create/CreateWidget.qml index c6ab1347..1e82e1b9 100644 --- a/ScreenPlay/qml/Create/CreateWidget.qml +++ b/ScreenPlay/qml/Create/CreateWidget.qml @@ -27,7 +27,7 @@ Item { id: btnCreateEmptyWidget text: qsTr("Create Emtpy Widget") anchors.top: txtCreate.bottom - anchors.topMargin: 20 + anchors.topMargin: 10 imgSource: "qrc:/assets/icons/icon_emptyWidget.svg" onClicked: { @@ -59,7 +59,7 @@ Item { Column { width: parent.width - spacing: 20 + spacing: 5 anchors { top: txtExamples.bottom topMargin: 10 @@ -220,3 +220,10 @@ Item { } ] } + + + +/*##^## Designer { + D{i:0;autoSize:true;height:480;width:640} +} + ##^##*/ diff --git a/ScreenPlay/qml/Create/CreateWidgetButton.qml b/ScreenPlay/qml/Create/CreateWidgetButton.qml index f5b1bb91..205c15e7 100644 --- a/ScreenPlay/qml/Create/CreateWidgetButton.qml +++ b/ScreenPlay/qml/Create/CreateWidgetButton.qml @@ -3,7 +3,7 @@ import QtGraphicalEffects 1.0 Item { id: btnEmpty - height: 63 + height: 75 anchors { right: parent.right left: parent.left @@ -15,11 +15,34 @@ Item { property string imgSource: "qrc:/assets/icons/icon_library_music.svg" + RectangularGlow { + id: effect + anchors { + top: bg.top + topMargin: 3 + left: bg.left + right: bg.right + } + height: bg.height + width: bg.width + glowRadius: 3 + spread: 0.2 + color: "black" + opacity: .4 + cornerRadius: 15 + } Rectangle { + id:bg width: parent.width - height: 60 - anchors.top: parent.top + anchors { + top:parent.top + right:parent.right + bottom:parent.bottom + left:parent.left + margins: 10 + } + radius: 3 Image { id:imgIcon diff --git a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml index b89e5bba..f7094856 100644 --- a/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml +++ b/ScreenPlay/qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml @@ -190,381 +190,348 @@ Item { } } } - - Item { - id: wrapperRight - width: parent.width * .5 - anchors { - top: txtHeadline.bottom - topMargin: 30 - bottom: parent.bottom - right: parent.right - } - - Column { - id: column - spacing: 20 - anchors.fill: parent - anchors.margins: 30 - anchors.topMargin: 0 - - TextField { - id: textField - placeholderText: qsTr("Name") - anchors.right: parent.right - anchors.left: parent.left - onTextChanged: { - if (textField.text.length >= 3) { - canNext = true - } else { - canNext = false - } - } - } - - TextField { - id: textField1 - placeholderText: qsTr("Description") - anchors.right: parent.right - anchors.left: parent.left - } - - TextField { - id: textField2 - placeholderText: qsTr("Youtube URL") - anchors.right: parent.right - anchors.left: parent.left - } - - TextField { - id: textField3 - placeholderText: qsTr("Tags") - anchors.right: parent.right - anchors.left: parent.left - } - } - - Row { - id: column1 - height: 100 - width: childrenRect.width - spacing: 10 - anchors { - horizontalCenter: parent.horizontalCenter - bottom: parent.bottom - } - - Button { - id: btnExit - text: qsTr("Abort") - Material.background: Material.Gray - Material.foreground: "white" - onClicked: { - screenPlayCreate.abort() - utility.setNavigationActive(true) - utility.setNavigation("Create") - } - } - - NextButton { - id: btnFinish - onClicked: { - if (btnFinish.state === "enabled" && canNext) { - screenPlayCreate.createWallpaperProjectFile( - textField.text, textField1.text) - } - } - } - } - - Connections { - target: screenPlayCreate - onCreateWallpaperStateChanged: { - if (state === Create.State.ConvertingVideoFinished) { - btnFinish.state = "enabled" - } - } - } - } } - Item { - id: wrapperError - anchors.fill: parent - opacity: 0 - - Text { - id: txtErrorHeadline - text: qsTr("An error occurred!") - anchors { - top: parent.top - topMargin: 30 - horizontalCenter: parent.horizontalCenter - } - height: 40 - font.family: "Segoe UI, Roboto" - font.weight: Font.Light - color: Material.color(Material.Red) - renderType: Text.NativeRendering - font.pixelSize: 32 - } - - Rectangle { - id: rectangle1 - color: "#eeeeee" - radius: 3 - anchors { - top: txtErrorHeadline.bottom - right: parent.right - bottom: btnBack.top - left: parent.left - margins: 30 - bottomMargin: 10 - } - - Flickable { - anchors.fill: parent - clip: true - contentHeight: txtFFMPEGDebug.paintedHeight - ScrollBar.vertical: ScrollBar { - snapMode: ScrollBar.SnapOnRelease - policy: ScrollBar.AlwaysOn - } - Text { - id: txtFFMPEGDebug - anchors { - top: parent.top - right: parent.right - left: parent.left - margins: 20 - } - wrapMode: Text.WordWrap - color: "#626262" - renderType: Text.NativeRendering - height: txtFFMPEGDebug.paintedHeight - } - Connections { - target: screenPlayCreate - onProcessOutput: { - txtFFMPEGDebug.text = text - } - } - } - } - - Button { - id: btnBack - text: qsTr("Back to create and send an error report!") - Material.background: Material.Orange - Material.foreground: "white" - anchors { - horizontalCenter: parent.horizontalCenter - bottom: parent.bottom - margins: 10 - } - onClicked: { - utility.setNavigationActive(true) - utility.setNavigation("Create") - } - } - } - - Item { - id: wrapperSuccess - anchors.fill: parent - opacity: 0 - - Text { - id: txtSuccessHeadline - text: qsTr("An error occurred!") - anchors { - top: parent.top - topMargin: 30 - horizontalCenter: parent.horizontalCenter - } - height: 40 - font.family: "Segoe UI, Roboto" - font.weight: Font.Light - color: Material.color(Material.Orange) - renderType: Text.NativeRendering - font.pixelSize: 32 - } - - Button { - id: btnSuccessBack - text: qsTr("Back to create!") - Material.background: Material.Orange - Material.foreground: "white" - anchors { - horizontalCenter: parent.horizontalCenter - bottom: parent.bottom - margins: 10 - } - onClicked: { - utility.setNavigationActive(true) - utility.setNavigation("Create") - } - } - } - - MouseArea { + id: wrapperRight + width: parent.width * .5 anchors { - top: parent.top + top: txtHeadline.bottom + topMargin: 30 + bottom: parent.bottom right: parent.right - margins: 5 - } - width: 32 - height: width - cursorShape: Qt.PointingHandCursor - onClicked: { - createNew.state = "out" - timerBack.start() } - Image { - id: imgClose - source: "qrc:/assets/icons/font-awsome/close.svg" - width: 16 - height: 16 - anchors.centerIn: parent - sourceSize: Qt.size(width, width) + Column { + id: column + spacing: 20 + anchors.fill: parent + anchors.margins: 30 + anchors.topMargin: 0 + + TextField { + id: textField + placeholderText: qsTr("Name") + anchors.right: parent.right + anchors.left: parent.left + onTextChanged: { + if (textField.text.length >= 3) { + canNext = true + } else { + canNext = false + } + } + } + + TextField { + id: textField1 + placeholderText: qsTr("Description") + anchors.right: parent.right + anchors.left: parent.left + } + + TextField { + id: textField2 + placeholderText: qsTr("Youtube URL") + anchors.right: parent.right + anchors.left: parent.left + } + + TextField { + id: textField3 + placeholderText: qsTr("Tags") + anchors.right: parent.right + anchors.left: parent.left + } } - ColorOverlay { - id: iconColorOverlay - anchors.fill: imgClose - source: imgClose - color: "gray" + + Row { + id: column1 + height: 100 + width: childrenRect.width + spacing: 10 + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + } + + Button { + id: btnExit + text: qsTr("Abort") + Material.background: Material.Gray + Material.foreground: "white" + onClicked: { + screenPlayCreate.abort() + utility.setNavigationActive(true) + utility.setNavigation("Create") + } + } + + NextButton { + id: btnFinish + onClicked: { + if (btnFinish.state === "enabled" && canNext) { + screenPlayCreate.createWallpaperProjectFile( + textField.text, textField1.text) + } + } + } } - Timer { - id: timerBack - interval: 800 - onTriggered: { - screenPlayCreate.abort() - utility.setNavigationActive(true) - utility.setNavigation("Create") + + Connections { + target: screenPlayCreate + onCreateWallpaperStateChanged: { + if (state === Create.State.ConvertingVideoFinished) { + btnFinish.state = "enabled" + } } } } } - states: [ - State { - name: "out" - PropertyChanges { - target: wrapper - anchors.topMargin: 800 - opacity: 0 + Item { + id: wrapperError + anchors.fill: parent + opacity: 0 + + Text { + id: txtErrorHeadline + text: qsTr("An error occurred!") + anchors { + top: parent.top + topMargin: 30 + horizontalCenter: parent.horizontalCenter } - PropertyChanges { - target: effect - opacity: 0 + height: 40 + font.family: "Segoe UI, Roboto" + font.weight: Font.Light + color: Material.color(Material.Red) + renderType: Text.NativeRendering + font.pixelSize: 32 + } + + Rectangle { + id: rectangle1 + color: "#eeeeee" + radius: 3 + anchors { + top: txtErrorHeadline.bottom + right: parent.right + bottom: btnBack.top + left: parent.left + margins: 30 + bottomMargin: 10 } - PropertyChanges { - target: wrapperError - opacity: 0 - } - }, - State { - name: "in" - PropertyChanges { - target: wrapper - anchors.topMargin: 40 - opacity: 1 - } - PropertyChanges { - target: effect - opacity: .4 - } - PropertyChanges { - target: wrapperError - opacity: 0 - } - }, - State { - name: "error" - PropertyChanges { - target: wrapper - anchors.topMargin: 40 - opacity: 1 - } - PropertyChanges { - target: effect - opacity: .4 - } - PropertyChanges { - target: wrapperContent - opacity: 0 - z: 0 - } - PropertyChanges { - target: wrapperError - opacity: 1 - } - }, - State { - name: "success" - PropertyChanges { - target: wrapper - anchors.topMargin: 40 - opacity: 1 - } - PropertyChanges { - target: effect - opacity: .4 - } - PropertyChanges { - target: wrapperContent - opacity: 0 - z: 0 - } - PropertyChanges { - target: wrapperError - opacity: 1 + + Flickable { + anchors.fill: parent + clip: true + contentHeight: txtFFMPEGDebug.paintedHeight + ScrollBar.vertical: ScrollBar { + snapMode: ScrollBar.SnapOnRelease + policy: ScrollBar.AlwaysOn + } + Text { + id: txtFFMPEGDebug + anchors { + top: parent.top + right: parent.right + left: parent.left + margins: 20 + } + wrapMode: Text.WordWrap + color: "#626262" + renderType: Text.NativeRendering + height: txtFFMPEGDebug.paintedHeight + } + Connections { + target: screenPlayCreate + onProcessOutput: { + txtFFMPEGDebug.text = text + } + } } } - ] - transitions: [ - Transition { - from: "out" - to: "in" - SequentialAnimation { - PauseAnimation { - duration: 400 - } - ParallelAnimation { - - PropertyAnimation { - target: wrapper - duration: 600 - property: "anchors.topMargin" - easing.type: Easing.InOutQuad - } - PropertyAnimation { - target: wrapper - duration: 600 - property: "opacity" - easing.type: Easing.InOutQuad - } - SequentialAnimation { - - PauseAnimation { - duration: 1000 - } - PropertyAnimation { - target: effect - duration: 300 - property: "opacity" - easing.type: Easing.InOutQuad - } - } - } + Button { + id: btnBack + text: qsTr("Back to create and send an error report!") + Material.background: Material.Orange + Material.foreground: "white" + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + margins: 10 } - }, - Transition { - from: "in" - to: "out" + onClicked: { + utility.setNavigationActive(true) + utility.setNavigation("Create") + } + } + } + Item { + id: wrapperSuccess + anchors.fill: parent + opacity: 0 + + Text { + id: txtSuccessHeadline + text: qsTr("An error occurred!") + anchors { + top: parent.top + topMargin: 30 + horizontalCenter: parent.horizontalCenter + } + height: 40 + font.family: "Segoe UI, Roboto" + font.weight: Font.Light + color: Material.color(Material.Orange) + renderType: Text.NativeRendering + font.pixelSize: 32 + } + + Button { + id: btnSuccessBack + text: qsTr("Back to create!") + Material.background: Material.Orange + Material.foreground: "white" + anchors { + horizontalCenter: parent.horizontalCenter + bottom: parent.bottom + margins: 10 + } + onClicked: { + utility.setNavigationActive(true) + utility.setNavigation("Create") + } + } + } + + MouseArea { + anchors { + top: parent.top + right: parent.right + margins: 5 + } + width: 32 + height: width + cursorShape: Qt.PointingHandCursor + onClicked: { + createNew.state = "out" + timerBack.start() + } + + Image { + id: imgClose + source: "qrc:/assets/icons/font-awsome/close.svg" + width: 16 + height: 16 + anchors.centerIn: parent + sourceSize: Qt.size(width, width) + } + ColorOverlay { + id: iconColorOverlay + anchors.fill: imgClose + source: imgClose + color: "gray" + } + Timer { + id: timerBack + interval: 800 + onTriggered: { + screenPlayCreate.abort() + utility.setNavigationActive(true) + utility.setNavigation("Create") + } + } + } + } + + states: [ + State { + name: "out" + PropertyChanges { + target: wrapper + anchors.topMargin: 800 + opacity: 0 + } + PropertyChanges { + target: effect + opacity: 0 + } + PropertyChanges { + target: wrapperError + opacity: 0 + } + }, + State { + name: "in" + PropertyChanges { + target: wrapper + anchors.topMargin: 40 + opacity: 1 + } + PropertyChanges { + target: effect + opacity: .4 + } + PropertyChanges { + target: wrapperError + opacity: 0 + } + }, + State { + name: "error" + PropertyChanges { + target: wrapper + anchors.topMargin: 40 + opacity: 1 + } + PropertyChanges { + target: effect + opacity: .4 + } + PropertyChanges { + target: wrapperContent + opacity: 0 + z: 0 + } + PropertyChanges { + target: wrapperError + opacity: 1 + } + }, + State { + name: "success" + PropertyChanges { + target: wrapper + anchors.topMargin: 40 + opacity: 1 + } + PropertyChanges { + target: effect + opacity: .4 + } + PropertyChanges { + target: wrapperContent + opacity: 0 + z: 0 + } + PropertyChanges { + target: wrapperError + opacity: 1 + } + } + ] + transitions: [ + Transition { + from: "out" + to: "in" + SequentialAnimation { + + PauseAnimation { + duration: 400 + } ParallelAnimation { PropertyAnimation { @@ -582,7 +549,7 @@ Item { SequentialAnimation { PauseAnimation { - duration: 500 + duration: 1000 } PropertyAnimation { target: effect @@ -592,49 +559,81 @@ Item { } } } - }, - Transition { - from: "in" - to: "error" - SequentialAnimation { - PropertyAnimation { - target: wrapperContent - duration: 600 - property: "opacity" - easing.type: Easing.InOutQuad - } - PauseAnimation { - duration: 50 - } - PropertyAnimation { - target: wrapperError - duration: 200 - property: "opacity" - easing.type: Easing.InOutQuad - } + } + }, + Transition { + from: "in" + to: "out" + + ParallelAnimation { + + PropertyAnimation { + target: wrapper + duration: 600 + property: "anchors.topMargin" + easing.type: Easing.InOutQuad + } + PropertyAnimation { + target: wrapper + duration: 600 + property: "opacity" + easing.type: Easing.InOutQuad } - }, - Transition { - from: "in" - to: "success" SequentialAnimation { - PropertyAnimation { - target: wrapperContent - duration: 600 - property: "opacity" - easing.type: Easing.InOutQuad - } + PauseAnimation { - duration: 50 + duration: 500 } PropertyAnimation { - target: wrapperSuccess - duration: 200 + target: effect + duration: 300 property: "opacity" easing.type: Easing.InOutQuad } } } - ] - } + }, + Transition { + from: "in" + to: "error" + SequentialAnimation { + PropertyAnimation { + target: wrapperContent + duration: 600 + property: "opacity" + easing.type: Easing.InOutQuad + } + PauseAnimation { + duration: 50 + } + PropertyAnimation { + target: wrapperError + duration: 200 + property: "opacity" + easing.type: Easing.InOutQuad + } + } + }, + Transition { + from: "in" + to: "success" + SequentialAnimation { + PropertyAnimation { + target: wrapperContent + duration: 600 + property: "opacity" + easing.type: Easing.InOutQuad + } + PauseAnimation { + duration: 50 + } + PropertyAnimation { + target: wrapperSuccess + duration: 200 + property: "opacity" + easing.type: Easing.InOutQuad + } + } + } + ] } diff --git a/ScreenPlay/src/create.cpp b/ScreenPlay/src/create.cpp index 144c8217..4ff845d5 100644 --- a/ScreenPlay/src/create.cpp +++ b/ScreenPlay/src/create.cpp @@ -190,7 +190,6 @@ bool Create::createWallpaperVideoPreview() QScopedPointer proConvertImage(new QProcess()); proConvertImage.data()->setArguments(args); - qDebug() << "Start converting video to preview gif"; #ifdef Q_OS_WIN proConvertImage.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg.exe"); #endif @@ -242,7 +241,6 @@ bool Create::createWallpaperVideoPreview() QScopedPointer proConvertPreviewMP4(new QProcess()); proConvertPreviewMP4.data()->setArguments(args); - qDebug() << "Start converting video to preview mp4"; #ifdef Q_OS_WIN proConvertPreviewMP4.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg.exe"); #endif @@ -291,7 +289,6 @@ bool Create::createWallpaperVideoPreview() QScopedPointer proConvertGif(new QProcess()); proConvertGif.data()->setArguments(args); - qDebug() << "Start converting video to preview gif"; #ifdef Q_OS_WIN proConvertGif.data()->setProgram(QApplication::applicationDirPath() + "/ffmpeg.exe"); #endif