2019-08-22 05:45:13 +10:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
|
|
|
|
HRectangle {
|
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
|
2019-08-22 05:45:13 +10:00
|
|
|
|
|
|
|
|
|
|
|
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 } }
|
|
|
|
}
|
|
|
|
}
|