From 2e72a01c6f5905fca4184ac3fb99031ebcaaa1f2 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Sat, 2 Apr 2022 14:50:40 -0500 Subject: [PATCH] adding a nextSlideAction instead of nextSlideText to allow for other types --- src/main.cpp | 4 +++- src/qml/main.qml | 1 + src/qml/presenter/MainWindow.qml | 2 +- src/qml/presenter/Presentation.qml | 33 +++++++++++++++++------------- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 4db08d4..06a8365 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) #ifdef Q_OS_WINDOWS QIcon::setFallbackThemeName("breeze"); QQuickStyle::setStyle(QStringLiteral("org.kde.breeze")); - QApplication::setStyle(QStringLiteral("breeze")); + // QApplication::setStyle(QStringLiteral("breeze")); #else QIcon::setFallbackThemeName("breeze"); QQuickStyle::setStyle(QStringLiteral("org.kde.desktop")); @@ -87,6 +87,8 @@ int main(int argc, char *argv[]) #endif QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("system-config-display"))); + qDebug() << QQuickStyle::availableStyles(); + qDebug() << QIcon::themeName(); // apparently mpv needs this class set // let's register mpv as well diff --git a/src/qml/main.qml b/src/qml/main.qml index 128d754..8d369d2 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -121,6 +121,7 @@ Kirigami.ApplicationWindow { /* print(Qt.application.state); */ screens = Qt.application.screens; presentationScreen = screens[1] + print(Kirigami.Settings.Style); for (let i = 0; i < screens.length; i++) { /* print(screens[i]); */ /* print(screens[i].name); */ diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index cfd0f1d..4389edb 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -125,7 +125,7 @@ Controls.Page { else presentation.text = item.text; presentation.textIndex = 0; - presentation.nextSlideText(); + presentation.nextSlideAction(); print("Slide changed to: " + item.name); } diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index f4bacd1..8378f8e 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -104,7 +104,7 @@ Item { Layout.alignment: Qt.AlignLeft MouseArea { anchors.fill: parent - onPressed: nextSlideText() + onPressed: nextSlideAction() cursorShape: Qt.PointingHandCursor } } @@ -122,20 +122,25 @@ Item { previewSlide.loadVideo(); } - function nextSlideText() { - if (textIndex === 0) { - previewSlide.text = root.text[textIndex]; - print(root.text[textIndex]); - textIndex++; - } else if (textIndex < root.text.length) { - previewSlide.text = root.text[textIndex]; - print(root.text[textIndex]); - textIndex++; - } else { - print("Next slide time"); + function nextSlideAction() { + if (itemType === "song") { + if (textIndex === 0) { + previewSlide.text = root.text[textIndex]; + print(root.text[textIndex]); + textIndex++; + } else if (textIndex < root.text.length) { + previewSlide.text = root.text[textIndex]; + print(root.text[textIndex]); + textIndex++; + } else { + print("Next slide time"); + textIndex = 0; + nextSlide(); + } + } else if (itemType === "video") + nextSlide(); + else if (itemType === "image") nextSlide(); - textIndex = 0; - } } function nextSlide() {