[Linux] New ear detection implementation (#145)

* New ear detection implementation

* [Linux] Improved case battery detection when not connected
This commit is contained in:
Tim Gromeyer
2025-06-07 09:19:14 +02:00
committed by GitHub
parent 3b20540c34
commit 5754dbfb16
9 changed files with 151 additions and 86 deletions

View File

@@ -1,16 +1,25 @@
import QtQuick 2.15
Column {
property bool isVisible: true
id: root
property bool inEar: true
property string iconSource
property int batteryLevel: 0
property bool isCharging: false
property string indicator: ""
property real targetOpacity: inEar ? 1 : 0.5
Timer {
id: opacityTimer
interval: 50
onTriggered: root.opacity = root.targetOpacity
}
onInEarChanged: {
opacityTimer.restart()
}
spacing: 5
opacity: inEar ? 1 : 0.5
visible: isVisible
Image {
source: parent.iconSource