the addition of a thumbnailer that works for videos

the previewSlideDelegate now uses the thumbnails instead
This commit is contained in:
Chris Cochrun 2023-02-08 14:16:26 -06:00
parent 1b55be29e5
commit 014a38a4f9
11 changed files with 638 additions and 37 deletions

View file

@ -245,8 +245,8 @@ FocusScope {
cellWidth: Kirigami.Units.gridUnit * 11
cellHeight: Kirigami.Units.gridUnit * 8
/* spacing: Kirigami.Units.smallSpacing * 2 */
cacheBuffer: 200
reuseItems: false
cacheBuffer: 800
reuseItems: true
clip: true
model: SlideModel
delegate: Presenter.PreviewSlideListDelegate { showVidBG: false }

View file

@ -10,6 +10,11 @@ Item {
implicitHeight: Kirigami.Units.gridUnit * 6.5
implicitWidth: Kirigami.Units.gridUnit * 10
property bool showVidBG
Component.onCompleted: {
if (model.videoBackground != "")
SlideModel.thumbnailVideo(model.videoBackground, model.serviceItemId, index);
}
Rectangle {
id: previewHighlight
anchors.centerIn: parent
@ -24,21 +29,17 @@ Item {
Kirigami.Theme.backgroundColor
}
Presenter.Slide {
Presenter.PreviewSlide {
id: previewSlideItem
anchors.centerIn: parent
implicitWidth: height / 9 * 16
implicitHeight: parent.height - Kirigami.Units.smallSpacing * 2
textSize: model.fontSize
itemType: model.type
imageSource: model.imageBackground
videoSource: showVidBG ? model.videoBackground : ""
audioSource: ""
imageSource: model.videoBackground != "" ? model.vidThumbnail : model.imageBackground
chosenFont: model.font
text: model.text
pdfIndex: slideIndex
preview: true
editMode: true
}
}
@ -59,8 +60,8 @@ Item {
anchors.fill: parent
hoverEnabled: true
onClicked: {
/* changeSlide(index); */
showPassiveNotification(SlideModel.thumbnailVideo(model.videoBackground, model.serviceItemId));
changeSlide(index);
/* showPassiveNotification(SlideModel.thumbnailVideo(model.videoBackground, model.serviceItemId, index)); */
}
cursorShape: Qt.PointingHandCursor
propagateComposedEvents: true
@ -69,7 +70,7 @@ Item {
Connections {
target: SlideModel
onDataChanged: {
function onDataChanged() {
if (active) {
previewSlidesList.currentIndex = index;
previewSlidesList.positionViewAtIndex(index, ListView.Contain);