moment/src/qml/Base/HButtonBackground.qml

30 lines
680 B
QML

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