37 lines
927 B
QML
37 lines
927 B
QML
// An inline warning strip — used for "the backend is gone" and "the helper is
|
|
// not installed", the two states where the app cannot do its job.
|
|
import QtQuick
|
|
import QtQuick.Controls.Material
|
|
import QtQuick.Layouts
|
|
|
|
Rectangle {
|
|
id: banner
|
|
property string text: ""
|
|
property string actionText: ""
|
|
signal actionClicked()
|
|
|
|
implicitHeight: visible ? row.implicitHeight + 20 : 0
|
|
color: "#e34948"
|
|
opacity: 0.92
|
|
|
|
RowLayout {
|
|
id: row
|
|
anchors.fill: parent
|
|
anchors.margins: 10
|
|
spacing: 12
|
|
Label {
|
|
text: banner.text
|
|
color: "white"
|
|
wrapMode: Text.WordWrap
|
|
Layout.fillWidth: true
|
|
}
|
|
Button {
|
|
visible: banner.actionText !== ""
|
|
text: banner.actionText
|
|
flat: true
|
|
Material.foreground: "white"
|
|
onClicked: banner.actionClicked()
|
|
}
|
|
}
|
|
}
|