From 86a5bbf93c69a69e3d7042797d5c03ac56a61360 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 12 Apr 2022 06:39:32 -0500 Subject: [PATCH] previous slide actions --- TODO.org | 8 ++++++-- src/qml/presenter/MainWindow.qml | 1 + src/qml/presenter/Presentation.qml | 27 +++++++++++++++++++-------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/TODO.org b/TODO.org index 28594ca..2d0b189 100644 --- a/TODO.org +++ b/TODO.org @@ -4,8 +4,9 @@ :END: * Inbox -** TODO implement previousSlide and previousAction -[[file:~/dev/church-presenter/src/qml/presenter/Presentation.qml::function nextSlide() {]] +** TODO bug in changing slides with the arrows +[[file:~/dev/church-presenter/src/qml/presenter/Presentation.qml::function changeSlide() {]] + ** TODO Check for edge cases in inputing wrong vorder and lyrics [[file:~/dev/church-presenter/TODO.org::*Fix broken append when importing River song][Fix broken append when importing River song]] @@ -57,6 +58,9 @@ This was due to the song not having a vorder. Need to protect from edge cases of the user inputing the formatted text that doesn't fit what's expected in code. +** DONE implement previousSlide and previousAction +[[file:~/dev/church-presenter/src/qml/presenter/Presentation.qml::function nextSlide() {]] + ** DONE Need to make ListModel capable of bringing in a string list [2/2] [100%] - [X] Create a Model - [X] Create a class that we'll make a list of in the model diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index 9eebae1..cfa5f3a 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -134,6 +134,7 @@ Controls.Page { presentation.loadVideo() } + print(item.text.length) if (item.text.length === 0) { presentation.text = [""]; } diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index ee6926b..c77e24c 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -55,13 +55,6 @@ Item { hoverEnabled: true onClicked: {} } - Controls.ToolButton { - id: backgroundButton - text: "Background" - icon.name: "fileopen" - hoverEnabled: true - onClicked: backgroundType.open() - } } } @@ -127,6 +120,7 @@ Item { } function nextSlideAction() { + print(textIndex); if (itemType === "song") { if (textIndex === 0) { previewSlide.text = root.text[textIndex]; @@ -158,7 +152,24 @@ Item { } function previousSlideAction() { - + print(textIndex); + if (itemType === "song") { + if (textIndex === 0) { + clearText(); + nextSlide(); + } else if (textIndex <= root.text.length) { + previewSlide.text = root.text[textIndex]; + print(root.text[textIndex]); + --textIndex + } + } else if (itemType === "video") { + clearText(); + previousSlide(); + } + else if (itemType === "image") { + clearText(); + previousSlide(); + } } function previousSlide() {