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
cacheBuffer: 900
reuseItems: true
model: ServiceItemModel
model: SlideModel
delegate: Presenter.PreviewSlideListDelegate {}
Kirigami.WheelHandler {

View file

@ -8,18 +8,14 @@ import org.presenter 1.0
Item {
id: root
// Lets set the outerModelData so we can access that data here.
property var outerModelData: model;
implicitHeight: Kirigami.Units.gridUnit * 6.5
implicitWidth: {
let slides = outerModelData.slideNumber === 0 ? 1 : outerModelData.slideNumber
return Kirigami.Units.gridUnit * 10 * slides + Kirigami.Units.smallSpacing * 2;
}
implicitWidth: Kirigami.Units.gridUnit * 10
Rectangle {
id: previewHighlight
anchors.centerIn: parent
width: parent.width
height: parent.height
height: parent.height - slidesTitle.height - 5
border.color: Kirigami.Theme.highlightColor
radius: 5
color: {
@ -29,56 +25,33 @@ Item {
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 {
id: previewSlideItem
implicitWidth: Kirigami.Units.gridUnit * 10 - Kirigami.Units.smallSpacing * 2
implicitHeight: width / 16 * 9
anchors.centerIn: parent
implicitWidth: height / 9 * 16
implicitHeight: parent.height - Kirigami.Units.smallSpacing * 2
textSize: width / 4
itemType: outerModelData.type
imageSource: outerModelData.backgroundType === "image" ? background : ""
videoSource: outerModelData.backgroundType === "video" ? background : ""
itemType: type
imageSource: imageBackground
videoSource: videoBackground
audioSource: ""
chosenFont: outerModelData.font
text: outerModelData.text[index] === "This is demo text" ? "" : outerModelData.text[index]
pdfIndex: outerModelData.type != "presentation" ? 0 : index
chosenFont: font
text: text
pdfIndex: slideIndex
preview: true
editMode: true
MouseArea {
id: innerMouse
anchors.fill: parent
hoverEnabled: true
onClicked: changeSlideAndIndex(outerModelData, index)
cursorShape: Qt.PointingHandCursor
}
}
}
}
Controls.Label {
id: slidesTitle
width: parent.width * 7
anchors.top: slidesList.bottom
anchors.leftMargin: Kirigami.Units.smallSpacing * 8
anchors.top: previewHighlight.bottom
/* anchors.leftMargin: Kirigami.Units.smallSpacing * 8 */
anchors.topMargin: 5
elide: Text.ElideRight
text: name
text: ServiceItemModel.getItem(serviceItemId).name
/* font.family: "Quicksand Bold" */
}
@ -93,11 +66,10 @@ Item {
Connections {
target: ServiceItemModel
target: SlideModel
onDataChanged: if (active)
previewSlidesList.positionViewAtIndex(index, ListView.Contain)
}
}
function changeSlideAndIndex(serviceItem, index) {
// TODO