bounds for presentation arrows and service items

This commit is contained in:
Chris Cochrun 2022-08-24 13:16:45 -05:00
parent af6f5678e4
commit 7c51d4a868
3 changed files with 18 additions and 1 deletions

View file

@ -238,7 +238,7 @@ ColumnLayout {
y: mouseHandler.mouseY + 10 y: mouseHandler.mouseY + 10
Kirigami.Action { Kirigami.Action {
text: "delete" text: "delete"
onTriggered: serviceItemModel.removeItem(index) onTriggered: removeItem(index);
} }
} }
@ -268,6 +268,15 @@ ColumnLayout {
} }
} }
Component.onCompleted: {
totalServiceItems = serviceItemList.count;
print("THE TOTAL SERVICE ITEMS: " + totalServiceItems);
}
function removeItem(index) {
serviceItemModel.removeItem(index);
totalServiceItems--;
}
function addItem(index, name, type, function addItem(index, name, type,
background, backgroundType, text, itemID) { background, backgroundType, text, itemID) {
@ -276,6 +285,7 @@ ColumnLayout {
serviceItemModel.insertItem(index, name, serviceItemModel.insertItem(index, name,
type, background, type, background,
backgroundType, newtext); backgroundType, newtext);
totalServiceItems++;
} }
function appendItem(name, type, background, backgroundType, text, itemID) { function appendItem(name, type, background, backgroundType, text, itemID) {
@ -292,6 +302,7 @@ ColumnLayout {
serviceItemModel.addItem(name, type, background, serviceItemModel.addItem(name, type, background,
backgroundType, lyrics); backgroundType, lyrics);
totalServiceItems++;
} }
function changeItem() { function changeItem() {

View file

@ -17,6 +17,7 @@ Controls.Page {
property url videoBackground: presentation.vidBackground property url videoBackground: presentation.vidBackground
property string currentText: presentation.text property string currentText: presentation.text
property int blurRadius: 0 property int blurRadius: 0
property int totalServiceItems
/* property var video */ /* property var video */

View file

@ -158,6 +158,8 @@ Item {
} }
function nextSlideAction() { function nextSlideAction() {
if (currentServiceItem === totalServiceItems)
return;
const nextServiceItemIndex = currentServiceItem + 1; const nextServiceItemIndex = currentServiceItem + 1;
const nextItem = serviceItemModel.getItem(nextServiceItemIndex); const nextItem = serviceItemModel.getItem(nextServiceItemIndex);
print("currentServiceItem " + currentServiceItem); print("currentServiceItem " + currentServiceItem);
@ -178,6 +180,9 @@ Item {
} }
function previousSlideAction() { function previousSlideAction() {
if (currentServiceItem === 0) {
return;
};
const prevServiceItemIndex = currentServiceItem - 1; const prevServiceItemIndex = currentServiceItem - 1;
const prevItem = serviceItemModel.getItem(prevServiceItemIndex); const prevItem = serviceItemModel.getItem(prevServiceItemIndex);
print("currentServiceItem " + currentServiceItem); print("currentServiceItem " + currentServiceItem);