30 lines
885 B
QML
30 lines
885 B
QML
// The little "what is the timer doing" chip, shown in the rail and the toolbar.
|
|
import QtQuick
|
|
import QtQuick.Controls.Material
|
|
|
|
Rectangle {
|
|
property bool running: false
|
|
property bool paused: false
|
|
property bool connected: true
|
|
property string text: ""
|
|
property color accent: "#2a78d6"
|
|
|
|
implicitWidth: Math.max(78, label.implicitWidth + 28)
|
|
implicitHeight: 32
|
|
radius: 16
|
|
color: !connected ? "#e34948" : (running ? accent : "transparent")
|
|
opacity: paused ? 0.6 : 1
|
|
border.width: running || !connected ? 0 : 1
|
|
border.color: Material.hintTextColor
|
|
|
|
Label {
|
|
id: label
|
|
anchors.centerIn: parent
|
|
text: parent.text
|
|
font.pixelSize: 13
|
|
font.weight: Font.DemiBold
|
|
font.family: "Roboto Mono, monospace"
|
|
color: (parent.running || !parent.connected) ? "white" : Material.foreground
|
|
}
|
|
}
|