some preliminary ui for viewing all slides in an item

This commit is contained in:
Chris Cochrun 2023-01-13 11:22:11 -06:00
parent f6b6fa8911
commit 83fcb59ea0

View file

@ -178,24 +178,17 @@ FocusScope {
ListView { ListView {
id: previewSlidesList id: previewSlidesList
/* Layout.fillHeight: true */
/* Layout.fillWidth: true */
/* Layout.columnSpan: 3 */
/* Layout.alignment: Qt.AlignBottom */
/* Layout.bottomMargin: 140 */
anchors.top: mainGrid.bottom anchors.top: mainGrid.bottom
anchors.bottom: root.bottom anchors.bottom: root.bottom
/* anchors.bottomMargin: 100 */
width: parent.width width: parent.width
orientation: ListView.Horizontal orientation: ListView.Horizontal
cacheBuffer: 900 cacheBuffer: 900
reuseItems: true reuseItems: true
model: serviceItemModel model: serviceItemModel
delegate: Repeater {
model: previewSlidesList.model.slideNumber
delegate: Rectangle { delegate: Rectangle {
id: previewHighlight id: previewHighlight
property var outerModelData: modelData
implicitWidth: 210 implicitWidth: 210
implicitHeight: width / 16 * 9 implicitHeight: width / 16 * 9
color: { color: {
@ -204,29 +197,38 @@ FocusScope {
else else
Kirigami.Theme.backgroundColor Kirigami.Theme.backgroundColor
} }
ListView {
Presenter.Slide { id: slidesList
anchors.centerIn: parent
implicitHeight: parent.height
model: outerModelData.slideNumber
orientation: ListView.Horizontal
cacheBuffer: 900
reuseItems: true
Component.onCompleted: showPassiveNotification(outerModelData.slideNumber)
delegate: Presenter.Slide {
id: previewSlideItem id: previewSlideItem
anchors.centerIn: parent anchors.centerIn: parent
implicitWidth: 200 implicitWidth: 200
implicitHeight: width / 16 * 9 implicitHeight: width / 16 * 9
textSize: width / 4 textSize: width / 4
itemType: type itemType: outerModelData.type
imageSource: backgroundType === "image" ? background : "" imageSource: outerModelData.backgroundType === "image" ? background : ""
videoSource: backgroundType === "video" ? background : "" videoSource: outerModelData.backgroundType === "video" ? background : ""
audioSource: "" audioSource: ""
chosenFont: font chosenFont: outerModelData.font
text: model.text[index] === "This is demo text" ? "" : model.text[index] text: outerModelData.text[index] === "This is demo text" ? "" : outerModelData.text[index]
pdfIndex: 0 pdfIndex: 0
preview: true preview: true
editMode: true editMode: true
} }
}
Controls.Label { Controls.Label {
id: slidesTitle id: slidesTitle
width: previewSlideItem.width width: previewSlideItem.width
anchors.top: previewSlideItem.bottom anchors.top: slidesList.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 5 anchors.topMargin: 5
elide: Text.ElideRight elide: Text.ElideRight
@ -234,6 +236,14 @@ FocusScope {
/* font.family: "Quicksand Bold" */ /* font.family: "Quicksand Bold" */
} }
Controls.ToolButton {
anchors.top: slidesTitle.bottom
text: "NUM"
icon.name: "viewimage"
hoverEnabled: true
onClicked: showPassiveNotification(slideNumber) && print(slideNumber);
}
MouseArea { MouseArea {
id: previewerMouse id: previewerMouse
anchors.fill: parent anchors.fill: parent
@ -249,7 +259,6 @@ FocusScope {
previewSlidesList.positionViewAtIndex(index, ListView.Center) previewSlidesList.positionViewAtIndex(index, ListView.Center)
} }
} }
}
Kirigami.WheelHandler { Kirigami.WheelHandler {
id: wheelHandler id: wheelHandler
target: previewSlidesList target: previewSlidesList