mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
OSD: add overdrive display
Volume/Microphone: allow overdrive, clamp to 100/150% max AudioService: properly clamp to 100/150% (not only visually)
This commit is contained in:
@@ -134,12 +134,20 @@ Item {
|
||||
icon: AudioService.getInputIcon()
|
||||
density: Settings.data.bar.density
|
||||
autoHide: false // Important to be false so we can hover as long as we want
|
||||
text: Math.round(AudioService.inputVolume * 100)
|
||||
text: {
|
||||
const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0;
|
||||
const displayVolume = Math.min(maxVolume, AudioService.inputVolume);
|
||||
return Math.round(displayVolume * 100);
|
||||
}
|
||||
suffix: "%"
|
||||
forceOpen: displayMode === "alwaysShow"
|
||||
forceClose: displayMode === "alwaysHide"
|
||||
tooltipText: I18n.tr("tooltips.microphone-volume-at", {
|
||||
"volume": Math.round(AudioService.inputVolume * 100)
|
||||
"volume": (() => {
|
||||
const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0;
|
||||
const displayVolume = Math.min(maxVolume, AudioService.inputVolume);
|
||||
return Math.round(displayVolume * 100);
|
||||
})()
|
||||
})
|
||||
|
||||
onWheel: function (delta) {
|
||||
|
||||
@@ -117,12 +117,20 @@ Item {
|
||||
oppositeDirection: BarService.getPillDirection(root)
|
||||
icon: AudioService.getOutputIcon()
|
||||
autoHide: false // Important to be false so we can hover as long as we want
|
||||
text: Math.round(AudioService.volume * 100)
|
||||
text: {
|
||||
const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0;
|
||||
const displayVolume = Math.min(maxVolume, AudioService.volume);
|
||||
return Math.round(displayVolume * 100);
|
||||
}
|
||||
suffix: "%"
|
||||
forceOpen: displayMode === "alwaysShow"
|
||||
forceClose: displayMode === "alwaysHide"
|
||||
tooltipText: I18n.tr("tooltips.volume-at", {
|
||||
"volume": Math.round(AudioService.volume * 100)
|
||||
"volume": (() => {
|
||||
const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0;
|
||||
const displayVolume = Math.min(maxVolume, AudioService.volume);
|
||||
return Math.round(displayVolume * 100);
|
||||
})()
|
||||
})
|
||||
|
||||
onWheel: function (delta) {
|
||||
|
||||
Reference in New Issue
Block a user