mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-03-06 14:26:07 +00:00
[Linux] Use segment control for setting noise control mode (#92)
* [Linux] Enhance GUI with icons * Improve visibility * Smarter hiding of battery values * Add simple opacity based ear detection indication * Hide disconnected devices * Add airpods 3 icon * Support more devices * Better icons * Add documentation * Add segmented control * Support keyboard navigation * Fix ear detection when primary pod changes * Support up to 9 modes with the keyboard * Redisign * Use id * Use correct images * Remove duplicates * Use correct image * Remove more merge conflicts * Remove unused code * Remove unused code * Make all text readbale
This commit is contained in:
@@ -21,7 +21,7 @@ ApplicationWindow {
|
||||
|
||||
Column {
|
||||
spacing: 5
|
||||
opacity: airPodsTrayApp.isLeftPodInEar ? 1 : 0.5
|
||||
opacity: airPodsTrayApp.leftPodInEar ? 1 : 0.5
|
||||
visible: airPodsTrayApp.battery.leftPodAvailable
|
||||
|
||||
Image {
|
||||
@@ -36,7 +36,6 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
BatteryIndicator {
|
||||
visible: airPodsTrayApp.leftPodAvailable
|
||||
batteryLevel: airPodsTrayApp.battery.leftPodLevel
|
||||
isCharging: airPodsTrayApp.battery.leftPodCharging
|
||||
darkMode: true
|
||||
@@ -46,7 +45,7 @@ ApplicationWindow {
|
||||
|
||||
Column {
|
||||
spacing: 5
|
||||
opacity: airPodsTrayApp.isRightPodInEar ? 1 : 0.5
|
||||
opacity: airPodsTrayApp.rightPodInEar ? 1 : 0.5
|
||||
visible: airPodsTrayApp.battery.rightPodAvailable
|
||||
|
||||
Image {
|
||||
@@ -62,7 +61,6 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
BatteryIndicator {
|
||||
visible: airPodsTrayApp.rightPodAvailable
|
||||
batteryLevel: airPodsTrayApp.battery.rightPodLevel
|
||||
isCharging: airPodsTrayApp.battery.rightPodCharging
|
||||
darkMode: true
|
||||
@@ -87,7 +85,6 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
BatteryIndicator {
|
||||
visible: airPodsTrayApp.caseAvailable
|
||||
batteryLevel: airPodsTrayApp.battery.caseLevel
|
||||
isCharging: airPodsTrayApp.battery.caseCharging
|
||||
darkMode: true
|
||||
@@ -95,19 +92,21 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
SegmentedControl {
|
||||
id: noiseControlMode
|
||||
// width: parent.width
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
model: ["Off", "Noise Cancellation", "Transparency", "Adaptive"]
|
||||
currentIndex: airPodsTrayApp.noiseControlMode
|
||||
onCurrentIndexChanged: airPodsTrayApp.noiseControlMode = currentIndex
|
||||
}
|
||||
|
||||
Text {
|
||||
id: earDetectionStatus
|
||||
text: "Ear Detection Status: " + airPodsTrayApp.earDetectionStatus
|
||||
color: "#ffffff"
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: noiseControlMode
|
||||
model: ["Off", "Noise Cancellation", "Transparency", "Adaptive"]
|
||||
currentIndex: airPodsTrayApp.noiseControlMode
|
||||
onCurrentIndexChanged: airPodsTrayApp.noiseControlMode = currentIndex
|
||||
}
|
||||
|
||||
Switch {
|
||||
id: caToggle
|
||||
text: "Conversational Awareness"
|
||||
@@ -116,6 +115,7 @@ ApplicationWindow {
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: noiseLevelSlider
|
||||
visible: airPodsTrayApp.adaptiveModeActive
|
||||
from: 0
|
||||
to: 100
|
||||
@@ -125,8 +125,8 @@ ApplicationWindow {
|
||||
property Timer debounceTimer: Timer {
|
||||
interval: 500 // 500ms delay after last change
|
||||
onTriggered: {
|
||||
if (!parent.pressed) {
|
||||
airPodsTrayApp.setAdaptiveNoiseLevel(parent.value)
|
||||
if (!noiseLevelSlider.pressed) {
|
||||
airPodsTrayApp.setAdaptiveNoiseLevel(noiseLevelSlider.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user