mirror of
https://github.com/overte-org/overte.git
synced 2025-07-24 10:43:55 +02:00
Merge pull request #12250 from druiz17/fix-multihighlight
Don't manually highlight tablet buttons from swipeview.
This commit is contained in:
commit
600cc1b48e
1 changed files with 13 additions and 16 deletions
|
@ -127,7 +127,7 @@ Item {
|
||||||
|
|
||||||
GridView {
|
GridView {
|
||||||
id: gridView
|
id: gridView
|
||||||
|
flickableDirection: Flickable.AutoFlickIfNeeded
|
||||||
keyNavigationEnabled: false
|
keyNavigationEnabled: false
|
||||||
highlightFollowsCurrentItem: false
|
highlightFollowsCurrentItem: false
|
||||||
|
|
||||||
|
@ -144,23 +144,20 @@ Item {
|
||||||
bottomMargin: 0
|
bottomMargin: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function setButtonState(buttonIndex, buttonstate) {
|
onCurrentIndexChanged: {
|
||||||
if (buttonIndex < 0 || gridView.contentItem === undefined
|
previousGridIndex = currentIndex
|
||||||
|| gridView.contentItem.children.length - 1 < buttonIndex) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var itemat = gridView.contentItem.children[buttonIndex].children[0];
|
|
||||||
if (itemat.isActive) {
|
|
||||||
itemat.state = "active state";
|
|
||||||
} else {
|
|
||||||
itemat.state = buttonstate;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
onMovementStarted: {
|
||||||
setButtonState(previousGridIndex, "base state");
|
if (currentIndex < 0 || gridView.currentItem === undefined || gridView.contentItem.children.length - 1 < currentIndex) {
|
||||||
setButtonState(currentIndex, "hover state");
|
return;
|
||||||
previousGridIndex = currentIndex
|
}
|
||||||
|
var button = gridView.contentItem.children[currentIndex].children[0];
|
||||||
|
if (button.isActive) {
|
||||||
|
button.state = "active state";
|
||||||
|
} else {
|
||||||
|
button.state = "base state";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cellWidth: width/3
|
cellWidth: width/3
|
||||||
|
|
Loading…
Reference in a new issue