moment/src/qml/Base/HButton.qml

43 lines
1021 B
QML
Raw Normal View History

2019-08-21 07:41:24 +10:00
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
Button {
id: button
spacing: theme.spacing
leftPadding: spacing / 1.5
2019-08-28 04:21:10 +10:00
rightPadding: leftPadding
topPadding: spacing / 2
2019-08-28 04:21:10 +10:00
bottomPadding: topPadding
iconItem.svgName: loading ? "hourglass" : icon.name
icon.color: theme.icons.colorize
2019-08-28 04:21:10 +10:00
enabled: ! loading
2019-08-21 07:41:24 +10:00
readonly property alias iconItem: contentItem.icon
readonly property alias label: contentItem.label
2019-08-21 07:41:24 +10:00
property color backgroundColor: theme.controls.button.background
property bool loading: false
property bool circle: false
property HToolTip toolTip: HToolTip {
id: toolTip
visible: text && hovered
}
2019-08-21 07:41:24 +10:00
background: HButtonBackground {
button: button
buttonTheme: theme.controls.button
2019-08-21 07:41:24 +10:00
radius: circle ? height : 0
color: backgroundColor
}
contentItem: HButtonContent {
id: contentItem
button: button
buttonTheme: theme.controls.button
2019-08-21 07:41:24 +10:00
}
}