feat(StatusBaseInput): add hover state visuals

Closes #285
This commit is contained in:
Pascal Precht 2021-07-23 11:57:16 +02:00 committed by Pascal Precht
parent 35f20e33df
commit e1ebdaae2c
1 changed files with 8 additions and 2 deletions

View File

@ -56,7 +56,12 @@ Item {
clip: true clip: true
border.width: 1 border.width: 1
border.color: edit.activeFocus ? Theme.palette.primaryColor1 : "transparent" border.color: {
if (edit.activeFocus) {
return Theme.palette.primaryColor1;
}
return sensor.containsMouse ? Theme.palette.primaryColor2 : "transparent"
}
Flickable { Flickable {
id: flick id: flick
@ -132,9 +137,10 @@ Item {
} // Flickable } // Flickable
MouseArea { MouseArea {
id: sensor
hoverEnabled: true
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.IBeamCursor cursorShape: Qt.IBeamCursor
enabled: !edit.activeFocus
onClicked: edit.forceActiveFocus() onClicked: edit.forceActiveFocus()
} }
} // Rectangle } // Rectangle