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,76 +178,85 @@ 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 { delegate: Rectangle {
model: previewSlidesList.model.slideNumber id: previewHighlight
delegate: Rectangle { property var outerModelData: modelData
id: previewHighlight implicitWidth: 210
implicitWidth: 210 implicitHeight: width / 16 * 9
implicitHeight: width / 16 * 9 color: {
color: { if (active || previewerMouse.containsMouse)
if (active || previewerMouse.containsMouse) Kirigami.Theme.highlightColor
Kirigami.Theme.highlightColor else
else Kirigami.Theme.backgroundColor
Kirigami.Theme.backgroundColor }
} ListView {
id: slidesList
Presenter.Slide { 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
text: name text: name
/* font.family: "Quicksand Bold" */ /* font.family: "Quicksand Bold" */
} }
MouseArea { Controls.ToolButton {
id: previewerMouse anchors.top: slidesTitle.bottom
anchors.fill: parent text: "NUM"
hoverEnabled: true icon.name: "viewimage"
onClicked: changeServiceItem(index) hoverEnabled: true
cursorShape: Qt.PointingHandCursor onClicked: showPassiveNotification(slideNumber) && print(slideNumber);
} }
MouseArea {
id: previewerMouse
anchors.fill: parent
hoverEnabled: true
onClicked: changeServiceItem(index)
cursorShape: Qt.PointingHandCursor
}
Connections { Connections {
target: serviceItemModel target: serviceItemModel
onDataChanged: if (active) onDataChanged: if (active)
previewSlidesList.positionViewAtIndex(index, ListView.Center) previewSlidesList.positionViewAtIndex(index, ListView.Center)
}
} }
} }
Kirigami.WheelHandler { Kirigami.WheelHandler {