mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 17:41:12 +02:00
Cleanup. Errors checks
This commit is contained in:
parent
35fee739c5
commit
afc3082593
1 changed files with 2 additions and 5 deletions
|
@ -139,11 +139,10 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setButtonState(buttonIndex, buttonstate) {
|
function setButtonState(buttonIndex, buttonstate) {
|
||||||
if (buttonIndex < 0) {
|
if (buttonIndex < 0 || gridView.contentItem === undefined
|
||||||
|
|| gridView.contentItem.children.length - 1 < buttonIndex) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.warn("changing item at", buttonIndex, buttonstate)
|
|
||||||
|
|
||||||
var itemat = gridView.contentItem.children[buttonIndex].children[0];
|
var itemat = gridView.contentItem.children[buttonIndex].children[0];
|
||||||
if (itemat.isActive) {
|
if (itemat.isActive) {
|
||||||
itemat.state = "active state";
|
itemat.state = "active state";
|
||||||
|
@ -154,7 +153,6 @@ Item {
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
setButtonState(previousGridIndex, "base state");
|
setButtonState(previousGridIndex, "base state");
|
||||||
console.warn("current index", currentIndex)
|
|
||||||
setButtonState(currentIndex, "hover state");
|
setButtonState(currentIndex, "hover state");
|
||||||
previousGridIndex = currentIndex
|
previousGridIndex = currentIndex
|
||||||
}
|
}
|
||||||
|
@ -166,7 +164,6 @@ Item {
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
id: wrapper
|
id: wrapper
|
||||||
objectName: "wrapper"
|
|
||||||
width: gridView.cellWidth
|
width: gridView.cellWidth
|
||||||
height: gridView.cellHeight
|
height: gridView.cellHeight
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue