Skip to content

Commit

Permalink
Highlight settings when changed by DependentOn
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed Jul 11, 2021
1 parent e559ef1 commit 03c51db
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qml/components/DependentOn.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ Item {
id: targetConnection
onChoiceChanged:
{
if(overlap.indexOf(target.choice) == -1)
if(parent.choice != undefined && overlap.indexOf(target.choice) == -1)
{
parent.reset()
parent.highlight()
}
}
}
Expand All @@ -34,6 +35,7 @@ Item {
if(parent.choice != undefined && overlap.indexOf(targetConnection.target.choice) == -1)
{
targetConnection.target.choice = overlap[0]
targetConnection.target.highlight()
}
}
}
Expand Down
22 changes: 22 additions & 0 deletions qml/components/Setting.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

}

0 comments on commit 03c51db

Please sign in to comment.