// One tile of the camera/microphone/screen strip: whether the thing is being // used right this second, and by what. // // PrivacyLiveTile { // glyph: "\u{F0100}" // label: "Camera" // active: PrivacyState.cameraActive // app: PrivacyState.cameraApp // } // // Deliberately still. An indicator that pulses or fades is reporting the same // fact over and over at sixty frames a second, and this one sits on a settings // page that may be open for a long time -- the border and the warn-toned line // carry the whole of the difference, and they carry it without repainting. import QtQuick import qs.config Rectangle { id: root property string glyph: "" property string label: "" property bool active: false // The application name PipeWire reported, which is often empty even while // a stream is plainly running. property string app: "" // Not `state`: Item already owns that name. readonly property string useLine: root.active ? "In use by " + (root.app !== "" ? root.app : "an application") : "Idle" implicitHeight: 56 radius: Theme.cardRadius color: Theme.alpha(Theme.bgDark, 0.55) border.width: 1 border.color: root.active ? Theme.alpha(Theme.warn, 0.45) : Theme.alpha(Theme.fg, 0.08) Text { id: icon anchors.left: parent.left anchors.leftMargin: 12 anchors.verticalCenter: parent.verticalCenter text: root.glyph color: root.active ? Theme.warn : Theme.fgDim font.family: Theme.fontMono font.pixelSize: 17 } Column { anchors.left: icon.right anchors.leftMargin: 10 anchors.right: parent.right anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter spacing: 2 Text { width: parent.width text: root.label color: Theme.fg font.family: Theme.fontFamily font.pixelSize: Theme.fontSizeSmall font.weight: Font.DemiBold elide: Text.ElideRight } Text { width: parent.width text: root.useLine color: root.active ? Theme.warn : Theme.fgDim font.family: Theme.fontFamily font.pixelSize: Math.max(9, Theme.fontSizeSmall - 1) elide: Text.ElideRight } } }