From 6953a7681feb6ac3321801e90767e325c077a9c7 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 13 Jan 2023 09:23:01 -0600 Subject: [PATCH] initial ui code for viewing multiple slides per item --- src/qml/presenter/Presentation.qml | 97 +++++++++++++++--------------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/src/qml/presenter/Presentation.qml b/src/qml/presenter/Presentation.qml index d55fe26..ee4f045 100644 --- a/src/qml/presenter/Presentation.qml +++ b/src/qml/presenter/Presentation.qml @@ -192,59 +192,62 @@ FocusScope { reuseItems: true model: serviceItemModel - delegate: Rectangle { - id: previewHighlight - implicitWidth: 210 - implicitHeight: width / 16 * 9 - color: { - if (active || previewerMouse.containsMouse) - Kirigami.Theme.highlightColor - else - Kirigami.Theme.backgroundColor - } - - Presenter.Slide { - id: previewSlideItem - anchors.centerIn: parent - implicitWidth: 200 + delegate: Repeater { + model: previewSlidesList.model.slideNumber + delegate: Rectangle { + id: previewHighlight + implicitWidth: 210 implicitHeight: width / 16 * 9 - textSize: width / 4 - itemType: type - imageSource: backgroundType === "image" ? background : "" - videoSource: backgroundType === "video" ? background : "" - audioSource: "" - chosenFont: font - text: model.text[0] === "This is demo text" ? "" : model.text[0] - pdfIndex: 0 - preview: true - editMode: true + color: { + if (active || previewerMouse.containsMouse) + Kirigami.Theme.highlightColor + else + Kirigami.Theme.backgroundColor + } - } + Presenter.Slide { + id: previewSlideItem + anchors.centerIn: parent + implicitWidth: 200 + implicitHeight: width / 16 * 9 + textSize: width / 4 + itemType: type + imageSource: backgroundType === "image" ? background : "" + videoSource: backgroundType === "video" ? background : "" + audioSource: "" + chosenFont: font + text: model.text[index] === "This is demo text" ? "" : model.text[index] + pdfIndex: 0 + preview: true + editMode: true - Controls.Label { - id: slidesTitle - width: previewSlideItem.width - anchors.top: previewSlideItem.bottom - anchors.horizontalCenter: parent.horizontalCenter - anchors.topMargin: 5 - elide: Text.ElideRight - text: name - /* font.family: "Quicksand Bold" */ - } + } - MouseArea { - id: previewerMouse - anchors.fill: parent - hoverEnabled: true - onClicked: changeServiceItem(index) - cursorShape: Qt.PointingHandCursor - } + Controls.Label { + id: slidesTitle + width: previewSlideItem.width + anchors.top: previewSlideItem.bottom + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: 5 + elide: Text.ElideRight + text: name + /* font.family: "Quicksand Bold" */ + } + + MouseArea { + id: previewerMouse + anchors.fill: parent + hoverEnabled: true + onClicked: changeServiceItem(index) + cursorShape: Qt.PointingHandCursor + } - Connections { - target: serviceItemModel - onDataChanged: if (active) - previewSlidesList.positionViewAtIndex(index, ListView.Center) + Connections { + target: serviceItemModel + onDataChanged: if (active) + previewSlidesList.positionViewAtIndex(index, ListView.Center) + } } } Kirigami.WheelHandler {