mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 07:13:57 +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) {
|
||||
if (buttonIndex < 0) {
|
||||
if (buttonIndex < 0 || gridView.contentItem === undefined
|
||||
|| gridView.contentItem.children.length - 1 < buttonIndex) {
|
||||
return;
|
||||
}
|
||||
console.warn("changing item at", buttonIndex, buttonstate)
|
||||
|
||||
var itemat = gridView.contentItem.children[buttonIndex].children[0];
|
||||
if (itemat.isActive) {
|
||||
itemat.state = "active state";
|
||||
|
@ -154,7 +153,6 @@ Item {
|
|||
|
||||
onCurrentIndexChanged: {
|
||||
setButtonState(previousGridIndex, "base state");
|
||||
console.warn("current index", currentIndex)
|
||||
setButtonState(currentIndex, "hover state");
|
||||
previousGridIndex = currentIndex
|
||||
}
|
||||
|
@ -166,7 +164,6 @@ Item {
|
|||
|
||||
delegate: Item {
|
||||
id: wrapper
|
||||
objectName: "wrapper"
|
||||
width: gridView.cellWidth
|
||||
height: gridView.cellHeight
|
||||
|
||||
|
|
Loading…
Reference in a new issue