51 lines
1.2 KiB
QML
51 lines
1.2 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import QtQuick.Controls.impl as I
|
|
import QtQuick.Templates as T
|
|
|
|
T.Button {
|
|
id: control
|
|
|
|
|
|
icon.color: Colors.foreground
|
|
icon.height: 21
|
|
icon.width: 21
|
|
implicitHeight: Math.max(
|
|
implicitBackgroundHeight + topInset + bottomInset,
|
|
implicitContentHeight + topPadding + bottomPadding
|
|
)
|
|
implicitWidth: Math.max(
|
|
implicitBackgroundWidth + leftInset + rightInset,
|
|
implicitContentWidth + leftPadding + rightPadding
|
|
)
|
|
padding: Dimensions.s - (icon.source.toString() === "" ? 0 : 1)
|
|
|
|
background: Rectangle {
|
|
anchors.fill: parent
|
|
color: Colors.primary
|
|
radius: Dimensions.radius
|
|
}
|
|
contentItem: I.IconLabel {
|
|
spacing: Dimensions.s
|
|
mirrored: control.mirrored
|
|
display: control.display
|
|
icon: control.icon
|
|
text: control.text
|
|
font: control.font
|
|
color: Colors.foreground
|
|
}
|
|
|
|
onIconChanged: () => {
|
|
// console.log("ICON '" + JSON.stringify(icon.source) + "' " + (icon.source.toString() === "") + " ");
|
|
}
|
|
|
|
MouseArea {
|
|
id: mouseArea
|
|
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onPressed: mouse => mouse.accepted = false
|
|
}
|
|
}
|