mirror of
https://github.com/AquaMorph/dotfiles.git
synced 2026-09-29 20:04:21 +00:00
35 lines
843 B
QML
35 lines
843 B
QML
import QtQuick
|
|
|
|
Rectangle {
|
|
id: root
|
|
|
|
property color blockColor: "#0288d1"
|
|
property color textColor: "#ffffff"
|
|
property bool interactive: false
|
|
property string text: ""
|
|
signal clicked(var mouse)
|
|
signal wheel(var wheel)
|
|
|
|
implicitWidth: label.implicitWidth + 20
|
|
implicitHeight: 32
|
|
color: blockColor
|
|
|
|
Text {
|
|
id: label
|
|
anchors.centerIn: parent
|
|
text: root.text
|
|
color: root.textColor
|
|
font.family: "SF Pro Display, Font Awesome 6 Free"
|
|
font.pixelSize: 18
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
enabled: root.interactive
|
|
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
|
|
cursorShape: Qt.PointingHandCursor
|
|
onClicked: mouse => root.clicked(mouse)
|
|
onWheel: wheel => root.wheel(wheel)
|
|
}
|
|
}
|