feat(StatusRoundButton): add `highlighted` and `icon.rotation` props

These are needed for some UIs where the icon state may change based on the
user's interaction.
This commit is contained in:
Pascal Precht 2021-06-14 13:21:25 +02:00 committed by Michał Cieślak
parent 9bf98a1ede
commit 04e74609f8
1 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,7 @@ Rectangle {
property StatusIconSettings icon: StatusIconSettings {
width: 23
height: 23
rotation: 0
color: {
switch(statusRoundButton.type) {
@ -34,6 +35,8 @@ Rectangle {
property alias hovered: sensor.containsMouse
property bool highlighted: false
property int type: StatusRoundButton.Type.Primary
signal pressed(var mouse)
@ -87,7 +90,7 @@ Rectangle {
color: {
if (statusRoundButton.enabled) {
return sensor.containsMouse ? backgroundSettings.hoverColor
return sensor.containsMouse || highlighted ? backgroundSettings.hoverColor
: backgroundSettings.color
} else {
return backgroundSettings.disabledColor
@ -109,6 +112,7 @@ Rectangle {
visible: !loading
icon: statusRoundButton.icon.name
rotation: statusRoundButton.icon.rotation
width: statusRoundButton.icon.width
height: statusRoundButton.icon.height