31 lines
750 B
QML
31 lines
750 B
QML
import QtQuick
|
|
import QtQuick.Templates as T
|
|
|
|
T.Button {
|
|
id: control
|
|
|
|
implicitHeight: implicitContentHeight
|
|
implicitWidth: contentItem.width
|
|
|
|
background: Rectangle {
|
|
color: Colors.primary
|
|
radius: Dimensions.radius
|
|
}
|
|
contentItem: Text {
|
|
color: Colors.foreground
|
|
font: control.font
|
|
padding: Dimensions.s + 2
|
|
text: control.text
|
|
// Make sure the button is at least wide enough to be comfortably clickable
|
|
width: Math.max(implicitWidth, 120)
|
|
horizontalAlignment: Text.AlignHCenter
|
|
}
|
|
|
|
MouseArea {
|
|
id: mouseArea
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
onPressed: (mouse) => mouse.accepted = false
|
|
}
|
|
}
|