making preview of slides aware of being active and set first item

This commit is contained in:
Chris Cochrun 2022-09-28 09:51:47 -05:00
parent 56086dfe74
commit ace9da585a
4 changed files with 78 additions and 17 deletions

View file

@ -41,7 +41,7 @@ Controls.Page {
property string editType
Component.onCompleted: refocusTimer.start()
Component.onCompleted: {refocusTimer.start(); changeServiceItem(0);}
Item {
id: mainItem
anchors.fill: parent
@ -160,6 +160,7 @@ Controls.Page {
/* presentation.itemType = item.type; */
print("Time to start changing");
serviceItemModel.activate(index);
SlideObject.changeSlide(item);
/* if (item.backgroundType === "video") */
@ -168,6 +169,7 @@ Controls.Page {
/* } */
presentation.textIndex = 0;
serviceItemModel.select(index);
/* presentation.changeSlide(); */
print("Slide changed to: " + item.name);

View file

@ -158,24 +158,56 @@ Item {
Layout.fillHeight: true
Layout.columnSpan: 3
orientation: ListView.Horizontal
cacheBuffer: 900
reuseItems: true
model: serviceItemModel
delegate: Presenter.Slide {
id: previewSlide
implicitWidth: 200
delegate: Rectangle {
id: previewHighlight
implicitWidth: 210
implicitHeight: width / 16 * 9
/* Layout.alignment: Qt.AlignCenter */
textSize: width / 15
itemType: root.itemType
imageSource: background
videoSource: background
audioSource: audio
chosenFont: font
text: text
pdfIndex: 0
preview: true
editMode: true
color: active ? Kirigami.Theme.highlightColor : Kirigami.Theme.backgroundColor
Presenter.Slide {
id: previewSlideItem
anchors.centerIn: parent
implicitWidth: 200
implicitHeight: width / 16 * 9
textSize: width / 15
itemType: type
imageSource: backgroundType === "image" ? background : ""
videoSource: backgroundType === "video" ? background : ""
audioSource: ""
chosenFont: font
text: text
pdfIndex: 0
preview: true
editMode: true
}
Controls.Label {
id: slidesTitle
width: previewSlideItem.width
anchors.top: previewSlideItem.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 5
elide: Text.ElideRight
text: name
/* font.family: "Quicksand Bold" */
}
}
Kirigami.WheelHandler {
id: wheelHandler
target: previewSlidesList
filterMouseEvents: true
}
}
Item {
/* Layout.preferredHeight: 200 */
Layout.fillHeight: true
Layout.fillWidth: true
Layout.columnSpan: 3
}
}
@ -204,12 +236,12 @@ Item {
}
function loadVideo() {
showPassiveNotification("Loading Video " + vidbackground)
/* showPassiveNotification("Loading Video " + vidbackground) */
previewSlide.loadVideo();
}
function stopVideo() {
showPassiveNotification("Stopping Video")
/* showPassiveNotification("Stopping Video") */
previewSlide.stopVideo()
}
@ -225,6 +257,7 @@ Item {
print(changed);
if (changed) {
currentServiceItem++;
changeServiceItem(currentServiceItem);
leftDock.changeItem();
}
}
@ -247,6 +280,7 @@ Item {
print(changed);
if (changed) {
currentServiceItem--;
changeServiceItem(currentServiceItem);
leftDock.changeItem();
}
}