moment/src/qml/Base/HButtonBackground.qml

32 lines
766 B
QML
Raw Normal View History

import QtQuick 2.12
import QtQuick.Controls 2.12
2019-08-28 12:46:31 +10:00
Rectangle {
2019-08-28 12:44:41 +10:00
color: buttonTheme.background
2019-08-28 04:21:10 +10:00
opacity: loading ? theme.loadingElementsOpacity :
enabled ? 1 : theme.disabledElementsOpacity
property AbstractButton button
property QtObject buttonTheme
Behavior on opacity { HOpacityAnimator {} }
2019-08-28 12:46:31 +10:00
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 } }
}
}