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() {
|
function nextSlideAction() {
|
||||||
keyHandler.forceActiveFocus();
|
keyHandler.forceActiveFocus();
|
||||||
print(currentServiceItem);
|
print(currentServiceItem);
|
||||||
if (currentServiceItem === totalServiceItems - 1)
|
|
||||||
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);
|
||||||
print("nextServiceItem " + nextServiceItemIndex);
|
print("nextServiceItem " + nextServiceItemIndex);
|
||||||
print(nextItem.name);
|
print(nextItem.name);
|
||||||
const changed = SlideObject.next(nextItem);
|
const change = SlideObject.next(nextItem);
|
||||||
print(changed);
|
print(change);
|
||||||
if (changed) {
|
if (currentServiceItem === totalServiceItems - 1 & change)
|
||||||
|
return;
|
||||||
|
if (change) {
|
||||||
|
SlideObject.changeSlide(nextItem);
|
||||||
currentServiceItem++;
|
currentServiceItem++;
|
||||||
changeServiceItem(currentServiceItem);
|
changeServiceItem(currentServiceItem);
|
||||||
leftDock.changeItem();
|
leftDock.changeItem();
|
||||||
|
@ -326,17 +327,18 @@ FocusScope {
|
||||||
|
|
||||||
function previousSlideAction() {
|
function previousSlideAction() {
|
||||||
keyHandler.forceActiveFocus();
|
keyHandler.forceActiveFocus();
|
||||||
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);
|
||||||
print("prevServiceItem " + prevServiceItemIndex);
|
print("prevServiceItem " + prevServiceItemIndex);
|
||||||
print(prevItem.name);
|
print(prevItem.name);
|
||||||
const changed = SlideObject.previous(prevItem);
|
const change = SlideObject.previous(prevItem);
|
||||||
print(changed);
|
print(change);
|
||||||
if (changed) {
|
if (currentServiceItem === 0 & change) {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
if (change) {
|
||||||
|
SlideObject.changeSlide(prevItem);
|
||||||
currentServiceItem--;
|
currentServiceItem--;
|
||||||
changeServiceItem(currentServiceItem);
|
changeServiceItem(currentServiceItem);
|
||||||
leftDock.changeItem();
|
leftDock.changeItem();
|
||||||
|
|
|
@ -269,7 +269,7 @@ bool Slide::next(QVariantMap nextItem)
|
||||||
qDebug() << "Slide Index: " << m_slideIndex << " Slide Size: " << m_slideSize;
|
qDebug() << "Slide Index: " << m_slideIndex << " Slide Size: " << m_slideSize;
|
||||||
QStringList text = m_serviceItem.value("text").toStringList();
|
QStringList text = m_serviceItem.value("text").toStringList();
|
||||||
if (m_slideIndex == m_slideSize) {
|
if (m_slideIndex == m_slideSize) {
|
||||||
changeSlide(nextItem);
|
// changeSlide(nextItem);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ bool Slide::previous(QVariantMap prevItem)
|
||||||
qDebug() << "Slide Index: " << m_slideIndex << " Slide Size: " << m_slideSize;
|
qDebug() << "Slide Index: " << m_slideIndex << " Slide Size: " << m_slideSize;
|
||||||
QStringList text = m_serviceItem.value("text").toStringList();
|
QStringList text = m_serviceItem.value("text").toStringList();
|
||||||
if (m_slideIndex == 1) {
|
if (m_slideIndex == 1) {
|
||||||
changeSlide(prevItem);
|
// changeSlide(prevItem);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue