Highlight settings when changed by DependentOn

This commit is contained in:
Anton Thomasson 2021-07-11 16:25:29 +02:00
parent e559ef1470
commit 03c51db3e5
2 changed files with 25 additions and 1 deletions

View file

@ -21,9 +21,10 @@ Item {
id: targetConnection id: targetConnection
onChoiceChanged: onChoiceChanged:
{ {
if(overlap.indexOf(target.choice) == -1) if(parent.choice != undefined && overlap.indexOf(target.choice) == -1)
{ {
parent.reset() parent.reset()
parent.highlight()
} }
} }
} }
@ -34,6 +35,7 @@ Item {
if(parent.choice != undefined && overlap.indexOf(targetConnection.target.choice) == -1) if(parent.choice != undefined && overlap.indexOf(targetConnection.target.choice) == -1)
{ {
targetConnection.target.choice = overlap[0] targetConnection.target.choice = overlap[0]
targetConnection.target.highlight()
} }
} }
} }

View file

@ -60,4 +60,26 @@ Item {
} }
} }
function highlight()
{
highlightAnimation.start()
}
NumberAnimation
{
id: highlightAnimation
target: fillRectangle
property: "opacity"
from: 0.5
to: 0
duration: 1000
}
Rectangle {
id: fillRectangle
anchors.fill: parent
color: Theme.highlightBackgroundColor
opacity: 0
}
} }