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
|
2019-08-21 18:39:07 +10:00
|
|
|
spacing: theme.spacing
|
|
|
|
leftPadding: spacing / 1.5
|
|
|
|
rightPadding: spacing / 1.5
|
|
|
|
topPadding: spacing / 2
|
|
|
|
bottomPadding: spacing / 2
|
2019-08-22 05:45:13 +10:00
|
|
|
iconItem.svgName: loading ? "hourglass" : icon.name
|
|
|
|
|
2019-08-21 07:41:24 +10:00
|
|
|
onVisibleChanged: if (! visible) loading = false
|
|
|
|
|
|
|
|
|
2019-08-22 05:45:13 +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
|
|
|
|
|
2019-08-22 23:27:26 +10:00
|
|
|
property HToolTip toolTip: HToolTip {
|
|
|
|
id: toolTip
|
|
|
|
visible: text && hovered
|
|
|
|
}
|
|
|
|
|
2019-08-21 07:41:24 +10:00
|
|
|
|
2019-08-22 05:45:13 +10:00
|
|
|
background: HButtonBackground {
|
|
|
|
button: button
|
|
|
|
buttonTheme: theme.controls.button
|
2019-08-21 07:41:24 +10:00
|
|
|
radius: circle ? height : 0
|
|
|
|
color: backgroundColor
|
|
|
|
}
|
|
|
|
|
2019-08-22 05:45:13 +10:00
|
|
|
contentItem: HButtonContent {
|
|
|
|
id: contentItem
|
|
|
|
button: button
|
|
|
|
buttonTheme: theme.controls.button
|
2019-08-21 07:41:24 +10:00
|
|
|
}
|
|
|
|
}
|