Adding reveal next and previous buttons

In order to make this work, I had to determine in rust which were html
and essentially not call the change_slide function and instead call
the reveal_next/previous functions and then tweak it from there.
This commit is contained in:
Chris Cochrun 2024-01-17 11:26:04 -06:00
parent b589cb2490
commit da258433d9
5 changed files with 35 additions and 17 deletions

View file

@ -120,9 +120,9 @@ FocusScope {
implicitHeight: width / 16 * 9
anchors.centerIn: parent
itemType: SlideObject.ty
imageSource: SlideObject.imageBackground.endsWith(".html") ? "" : SlideObject.imageBackground
webSource: SlideObject.imageBackground.endsWith(".html") ? SlideObject.imageBackground : ""
htmlVisible: SlideObject.imageBackground.endsWith(".html")
imageSource: SlideObject.html ? "" : SlideObject.imageBackground
webSource: SlideObject.html ? SlideObject.imageBackground : ""
htmlVisible: SlideObject.html
videoSource: SlideObject.videoBackground
audioSource: SlideObject.audio
chosenFont: SlideObject.font
@ -467,9 +467,8 @@ FocusScope {
keyHandler.forceActiveFocus();
const nextSlideIdx = currentSlide + 1;
const nextSlide = SlideModel.getItem(nextSlideIdx);
/* if (!SlideObject.imageBackground.endsWith(".html") && */
/* (nextSlideIdx > totalSlides || nextSlideIdx < 0)) */
/* return; */
if (nextSlideIdx > totalSlides || nextSlideIdx < 0)
return;
console.log("currentServiceItem " + currentServiceItem);
console.log("totalSlides " + totalSlides);
console.log("currentSlide " + currentSlide);
@ -491,12 +490,18 @@ FocusScope {
function previousSlideAction() {
keyHandler.forceActiveFocus();
const prevSlideIdx = currentSlide - 1;
const prevSlide = SlideModel.getItem(prevSlideIdx);
if (prevSlideIdx > totalSlides || prevSlideIdx < 0)
return;
console.log("currentServiceItem " + currentServiceItem);
console.log("totalSlides " + totalSlides);
console.log("currentSlide " + currentSlide);
console.log("prevSlideIdx " + prevSlideIdx);
changeSlide(prevSlideIdx);
/* changeSlide(prevSlideIdx); */
if (SlideObject.previous(prevSlide)) {
currentSlide = prevSlideIdx;
currentServiceItem = prevSlide.serviceItemId;
}
}
function previousSlide() {

View file

@ -49,9 +49,9 @@ Item {
Presenter.Slide {
id: presentationSlide
anchors.fill: parent
imageSource: SlideObj.imageBackground.endsWith(".html") ? "" : SlideObj.imageBackground
webSource: SlideObj.imageBackground.endsWith(".html") ? SlideObj.imageBackground : ""
htmlVisible: SlideObj.imageBackground.endsWith(".html")
imageSource: SlideObj.html ? "" : SlideObj.imageBackground
webSource: SlideObj.html ? SlideObj.imageBackground : ""
htmlVisible: SlideObj.html
videoSource: presentationWindow.visible ? SlideObj.videoBackground : ""
audioSource: SlideObj.audio
text: SlideObj.text

View file

@ -191,11 +191,14 @@ Item {
anchors.fill: parent
url: webSource
visible: htmlVisible
enabled: htmlVisible
zoomFactor: preview ? 0.25 : 1.0
onLoadingChanged: {
if (loadRequest.status == 2)
showPassiveNotification("yahoo?");
}
settings.playbackRequiresUserGesture: false
audioMuted: root.preview
/* function moveToSlideIndex(index) { */
/* web.runJavaScript(" */