From 246c75c789f23e89f843030149d11dc96aab37ab Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Mon, 6 Feb 2023 15:00:44 -0600 Subject: [PATCH] adding a PreviewSlide.qml file to hold the smaller delegate for PreviewSlideLists --- src/qml/presenter/PreviewSlide.qml | 81 ++++++++++++++++++++++++++++++ src/resources.qrc | 1 + 2 files changed, 82 insertions(+) create mode 100644 src/qml/presenter/PreviewSlide.qml diff --git a/src/qml/presenter/PreviewSlide.qml b/src/qml/presenter/PreviewSlide.qml new file mode 100644 index 0000000..9cba6a8 --- /dev/null +++ b/src/qml/presenter/PreviewSlide.qml @@ -0,0 +1,81 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 as Controls +import QtQuick.Layouts 1.2 +import QtMultimedia 5.15 +/* import QtAudioEngine 1.15 */ +import QtGraphicalEffects 1.15 +import org.kde.kirigami 2.13 as Kirigami +import "./" as Presenter + +Item { + id: root + + // These properties are for the slides visuals + property real textSize: 50 + property bool dropShadow: false + property url imageSource + property int pdfIndex + property string chosenFont: "Quicksand" + property string text + property color backgroundColor + property var hTextAlignment: Text.AlignHCenter + property var vTextAlignment: Text.AlignVCenter + + // These properties help to determine the state of the slide + property string itemType + + implicitWidth: 1920 + implicitHeight: 1080 + + Rectangle { + id: basePrColor + anchors.fill: parent + color: "black" + + Image { + id: backgroundImage + anchors.fill: parent + source: imageSource + fillMode: itemType == "song" ? Image.PreserveAspectCrop : Image.PreserveAspectFit + clip: true + visible: true + currentFrame: pdfIndex + } + + FastBlur { + id: imageBlue + anchors.fill: parent + source: backgroundImage + radius: blurRadius + + Controls.Label { + id: lyrics + text: root.text + /* text: root.width / textSize */ + font.pixelSize: root.width / 1000 * root.textSize + /* minimumPointSize: 5 */ + fontSizeMode: Text.Fit + font.family: chosenFont + horizontalAlignment: hTextAlignment + verticalAlignment: vTextAlignment + style: Text.Raised + wrapMode: Text.WordWrap + anchors.fill: parent + anchors.topMargin: 10 + anchors.bottomMargin: 10 + anchors.leftMargin: 10 + anchors.rightMargin: 10 + clip: true + + layer.enabled: true + layer.effect: DropShadow { + horizontalOffset: 5 + verticalOffset: 5 + radius: 11.0 + samples: 24 + color: "#80000000" + } + } + } + } +} diff --git a/src/resources.qrc b/src/resources.qrc index 0708a73..3f26265 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -19,6 +19,7 @@ qml/presenter/Presentation.qml qml/presenter/PresentationWindow.qml qml/presenter/PreviewSlideListDelegate.qml + qml/presenter/PreviewSlide.qml qml/presenter/Settings.qml assets/parallel.jpg assets/black.jpg