mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-02-03 08:39:12 +00:00
[Linux] New ear detection implementation (#145)
* New ear detection implementation * [Linux] Improved case battery detection when not connected
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user