moment/src/qml/Base/HButtonBackground.qml
miruka 7f89604789 button/checkbox: highlight on activeFocus
Not just tab-induced focus.
2019-09-09 07:19:06 -04:00

32 lines
766 B
QML

import QtQuick 2.12
import QtQuick.Controls 2.12
Rectangle {
color: buttonTheme.background
opacity: loading ? theme.loadingElementsOpacity :
enabled ? 1 : theme.disabledElementsOpacity
property AbstractButton button
property QtObject buttonTheme
Behavior on opacity { HNumberAnimation {} }
Rectangle {
anchors.fill: parent
radius: parent.radius
color: button.checked ? buttonTheme.checkedOverlay :
button.enabled && button.pressed ? buttonTheme.pressedOverlay :
(button.enabled && button.hovered) || button.activeFocus ?
buttonTheme.hoveredOverlay :
"transparent"
Behavior on color { HColorAnimation { factor: 0.5 } }
}
}