visually see slides

This commit is contained in:
Chris Cochrun 2023-01-20 07:31:54 -06:00
parent 983bb24259
commit d70cd4091c
2 changed files with 42 additions and 70 deletions

View file

@ -187,7 +187,7 @@ FocusScope {
spacing: Kirigami.Units.smallSpacing * 2 spacing: Kirigami.Units.smallSpacing * 2
cacheBuffer: 900 cacheBuffer: 900
reuseItems: true reuseItems: true
model: ServiceItemModel model: SlideModel
delegate: Presenter.PreviewSlideListDelegate {} delegate: Presenter.PreviewSlideListDelegate {}
Kirigami.WheelHandler { Kirigami.WheelHandler {

View file

@ -8,18 +8,14 @@ import org.presenter 1.0
Item { Item {
id: root id: root
// Lets set the outerModelData so we can access that data here. // Lets set the outerModelData so we can access that data here.
property var outerModelData: model;
implicitHeight: Kirigami.Units.gridUnit * 6.5 implicitHeight: Kirigami.Units.gridUnit * 6.5
implicitWidth: { implicitWidth: Kirigami.Units.gridUnit * 10
let slides = outerModelData.slideNumber === 0 ? 1 : outerModelData.slideNumber
return Kirigami.Units.gridUnit * 10 * slides + Kirigami.Units.smallSpacing * 2;
}
Rectangle { Rectangle {
id: previewHighlight id: previewHighlight
anchors.centerIn: parent
width: parent.width width: parent.width
height: parent.height height: parent.height - slidesTitle.height - 5
border.color: Kirigami.Theme.highlightColor border.color: Kirigami.Theme.highlightColor
radius: 5 radius: 5
color: { color: {
@ -29,56 +25,33 @@ Item {
Kirigami.Theme.backgroundColor Kirigami.Theme.backgroundColor
} }
// I couldn't get another listview to work but I may try it again
Row {
id: slidesList
spacing: Kirigami.Units.smallSpacing * 2
anchors.fill: parent
padding: Kirigami.Units.smallSpacing * 2
Repeater {
id: slidesListRepeater
model: outerModelData.slideNumber === 0 ? 1 : outerModelData.slideNumber
Component.onCompleted: {
if (name === "Death Was Arrested") {
console.log("Number of slides: " + outerModelData.slideNumber);
console.log("model number: " + model);
}
}
/* Rectangle { width: 20; height: 20; radius: 10; color: "green" } */
Presenter.Slide { Presenter.Slide {
id: previewSlideItem id: previewSlideItem
implicitWidth: Kirigami.Units.gridUnit * 10 - Kirigami.Units.smallSpacing * 2 anchors.centerIn: parent
implicitHeight: width / 16 * 9 implicitWidth: height / 9 * 16
implicitHeight: parent.height - Kirigami.Units.smallSpacing * 2
textSize: width / 4 textSize: width / 4
itemType: outerModelData.type itemType: type
imageSource: outerModelData.backgroundType === "image" ? background : "" imageSource: imageBackground
videoSource: outerModelData.backgroundType === "video" ? background : "" videoSource: videoBackground
audioSource: "" audioSource: ""
chosenFont: outerModelData.font chosenFont: font
text: outerModelData.text[index] === "This is demo text" ? "" : outerModelData.text[index] text: text
pdfIndex: outerModelData.type != "presentation" ? 0 : index pdfIndex: slideIndex
preview: true preview: true
editMode: true editMode: true
MouseArea {
id: innerMouse
anchors.fill: parent
hoverEnabled: true
onClicked: changeSlideAndIndex(outerModelData, index)
cursorShape: Qt.PointingHandCursor
}
}
} }
} }
Controls.Label { Controls.Label {
id: slidesTitle id: slidesTitle
width: parent.width * 7 width: parent.width * 7
anchors.top: slidesList.bottom anchors.top: previewHighlight.bottom
anchors.leftMargin: Kirigami.Units.smallSpacing * 8 /* anchors.leftMargin: Kirigami.Units.smallSpacing * 8 */
anchors.topMargin: 5 anchors.topMargin: 5
elide: Text.ElideRight elide: Text.ElideRight
text: name text: ServiceItemModel.getItem(serviceItemId).name
/* font.family: "Quicksand Bold" */ /* font.family: "Quicksand Bold" */
} }
@ -93,11 +66,10 @@ Item {
Connections { Connections {
target: ServiceItemModel target: SlideModel
onDataChanged: if (active) onDataChanged: if (active)
previewSlidesList.positionViewAtIndex(index, ListView.Contain) previewSlidesList.positionViewAtIndex(index, ListView.Contain)
} }
}
function changeSlideAndIndex(serviceItem, index) { function changeSlideAndIndex(serviceItem, index) {
// TODO // TODO