feat(StatusFlatRoundButton): introduce `highlighted` color for secondary type

Closes 
This commit is contained in:
Pascal Precht 2021-07-13 17:05:31 +02:00 committed by Michał Cieślak
parent 4fcdbab22e
commit 17d5978fe4
2 changed files with 16 additions and 2 deletions
ui/StatusQ
sandbox
src/StatusQ/Controls

View File

@ -450,6 +450,9 @@ Rectangle {
chatInfoButton.subTitle: "Community Chat"
chatInfoButton.icon.color: Theme.palette.miscColor6
chatInfoButton.type: StatusChatInfoButton.Type.CommunityChat
searchButton.onClicked: searchButton.highlighted = !searchButton.highlighted
membersButton.onClicked: membersButton.highlighted = !membersButton.highlighted
}
}
}

View File

@ -78,6 +78,15 @@ Rectangle {
return "transparent";
}
}
property color highlightedColor: {
switch(statusFlatRoundButton.type) {
case StatusFlatRoundButton.Type.Primary:
return Theme.palette.primaryColor3;
case StatusFlatRoundButton.Type.Secondary:
return Theme.palette.baseColor4;
}
}
}
implicitWidth: 44
@ -86,8 +95,10 @@ Rectangle {
color: {
if (statusFlatRoundButton.enabled) {
return sensor.containsMouse || highlighted ? backgroundSettings.hoverColor
: backgroundSettings.color
if (sensor.containsMouse) {
return backgroundSettings.hoverColor
}
return highlighted ? backgroundSettings.highlightedColor : backgroundSettings.color
} else {
return backgroundSettings.disabledColor
}