moment/src/gui/Base/HButtonBackground.qml

34 lines
802 B
QML
Raw Normal View History

2019-12-19 22:46:16 +11:00
// SPDX-License-Identifier: LGPL-3.0-or-later
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 var button
property QtObject buttonTheme
2019-12-16 19:42:41 +11:00
Behavior on opacity { HNumberAnimation {} }
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 } }
}
}