|
|
@ -148,38 +148,29 @@ PlasmaComponents.Page {
|
|
|
|
|
|
|
|
|
|
|
|
Component.onCompleted: screenRow.updateScreens();
|
|
|
|
Component.onCompleted: screenRow.updateScreens();
|
|
|
|
|
|
|
|
|
|
|
|
//they are used to restore the index when the screen edge
|
|
|
|
|
|
|
|
//is occupied
|
|
|
|
|
|
|
|
property bool acceptedIndex: true
|
|
|
|
|
|
|
|
property int previousIndex: -1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onCurrentIndexChanged: {
|
|
|
|
|
|
|
|
//it is used to restore the index when the screen edge
|
|
|
|
|
|
|
|
//is occupied
|
|
|
|
|
|
|
|
if (!acceptedIndex) {
|
|
|
|
|
|
|
|
acceptedIndex = true;
|
|
|
|
|
|
|
|
currentIndex = previousIndex;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onActivated: {
|
|
|
|
onActivated: {
|
|
|
|
previousIndex = currentIndex;
|
|
|
|
var succeed = false;
|
|
|
|
|
|
|
|
|
|
|
|
if (index === 0) {
|
|
|
|
if (index === 0) {
|
|
|
|
var succeed = latteView.positioner.setCurrentScreen("primary");
|
|
|
|
succeed = latteView.positioner.setCurrentScreen("primary");
|
|
|
|
|
|
|
|
|
|
|
|
latteView.onPrimary = true;
|
|
|
|
if (succeed) {
|
|
|
|
acceptedIndex = true;
|
|
|
|
latteView.onPrimary = true;
|
|
|
|
|
|
|
|
} else if (!latteView.onPrimary){
|
|
|
|
|
|
|
|
console.log("the edge is already occupied!!!");
|
|
|
|
|
|
|
|
currentIndex = findScreen(latteView.positioner.currentScreenName);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (index>0 && (index !== findScreen(latteView.positioner.currentScreenName) || latteView.onPrimary)) {
|
|
|
|
} else if (index>0 && (index !== findScreen(latteView.positioner.currentScreenName) || latteView.onPrimary)) {
|
|
|
|
console.log("current index changed!!! :"+ index);
|
|
|
|
console.log("current index changed!!! :"+ index);
|
|
|
|
console.log("screen must be changed...");
|
|
|
|
console.log("screen must be changed...");
|
|
|
|
|
|
|
|
|
|
|
|
var succeed = latteView.positioner.setCurrentScreen(textAt(index));
|
|
|
|
succeed = latteView.positioner.setCurrentScreen(textAt(index));
|
|
|
|
|
|
|
|
|
|
|
|
if(succeed) {
|
|
|
|
if(succeed) {
|
|
|
|
latteView.onPrimary = false;
|
|
|
|
latteView.onPrimary = false;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
console.log("the edge is already occupied!!!");
|
|
|
|
console.log("the edge is already occupied!!!");
|
|
|
|
acceptedIndex = false;
|
|
|
|
currentIndex = findScreen(latteView.positioner.currentScreenName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|