fixing bugs in advancing slide at end or begninning
This commit is contained in:
parent
98b9e7aa13
commit
19fbb392d7
2 changed files with 15 additions and 13 deletions
|
@ -303,16 +303,17 @@ FocusScope {
|
|||
function nextSlideAction() {
|
||||
keyHandler.forceActiveFocus();
|
||||
print(currentServiceItem);
|
||||
if (currentServiceItem === totalServiceItems - 1)
|
||||
return;
|
||||
const nextServiceItemIndex = currentServiceItem + 1;
|
||||
const nextItem = serviceItemModel.getItem(nextServiceItemIndex);
|
||||
print("currentServiceItem " + currentServiceItem);
|
||||
print("nextServiceItem " + nextServiceItemIndex);
|
||||
print(nextItem.name);
|
||||
const changed = SlideObject.next(nextItem);
|
||||
print(changed);
|
||||
if (changed) {
|
||||
const change = SlideObject.next(nextItem);
|
||||
print(change);
|
||||
if (currentServiceItem === totalServiceItems - 1 & change)
|
||||
return;
|
||||
if (change) {
|
||||
SlideObject.changeSlide(nextItem);
|
||||
currentServiceItem++;
|
||||
changeServiceItem(currentServiceItem);
|
||||
leftDock.changeItem();
|
||||
|
@ -326,17 +327,18 @@ FocusScope {
|
|||
|
||||
function previousSlideAction() {
|
||||
keyHandler.forceActiveFocus();
|
||||
if (currentServiceItem === 0) {
|
||||
return;
|
||||
};
|
||||
const prevServiceItemIndex = currentServiceItem - 1;
|
||||
const prevItem = serviceItemModel.getItem(prevServiceItemIndex);
|
||||
print("currentServiceItem " + currentServiceItem);
|
||||
print("prevServiceItem " + prevServiceItemIndex);
|
||||
print(prevItem.name);
|
||||
const changed = SlideObject.previous(prevItem);
|
||||
print(changed);
|
||||
if (changed) {
|
||||
const change = SlideObject.previous(prevItem);
|
||||
print(change);
|
||||
if (currentServiceItem === 0 & change) {
|
||||
return;
|
||||
};
|
||||
if (change) {
|
||||
SlideObject.changeSlide(prevItem);
|
||||
currentServiceItem--;
|
||||
changeServiceItem(currentServiceItem);
|
||||
leftDock.changeItem();
|
||||
|
|
|
@ -269,7 +269,7 @@ bool Slide::next(QVariantMap nextItem)
|
|||
qDebug() << "Slide Index: " << m_slideIndex << " Slide Size: " << m_slideSize;
|
||||
QStringList text = m_serviceItem.value("text").toStringList();
|
||||
if (m_slideIndex == m_slideSize) {
|
||||
changeSlide(nextItem);
|
||||
// changeSlide(nextItem);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -300,7 +300,7 @@ bool Slide::previous(QVariantMap prevItem)
|
|||
qDebug() << "Slide Index: " << m_slideIndex << " Slide Size: " << m_slideSize;
|
||||
QStringList text = m_serviceItem.value("text").toStringList();
|
||||
if (m_slideIndex == 1) {
|
||||
changeSlide(prevItem);
|
||||
// changeSlide(prevItem);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue