mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
feat(bar-audio): added interface nickname in tooltip
This commit is contained in:
@@ -147,13 +147,15 @@ Item {
|
||||
if (PanelService.getPanel("audioPanel", screen)?.isPanelOpen) {
|
||||
return "";
|
||||
} else {
|
||||
return I18n.tr("tooltips.microphone-volume-at", {
|
||||
"volume": (() => {
|
||||
const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0;
|
||||
const displayVolume = Math.min(maxVolume, AudioService.inputVolume);
|
||||
return Math.round(displayVolume * 100);
|
||||
})()
|
||||
});
|
||||
const nick = AudioService.source?.nickname ?? "";
|
||||
const volumeText = I18n.tr("tooltips.microphone-volume-at", {
|
||||
"volume": (() => {
|
||||
const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0;
|
||||
const displayVolume = Math.min(maxVolume, AudioService.inputVolume);
|
||||
return Math.round(displayVolume * 100);
|
||||
})()
|
||||
});
|
||||
return nick ? volumeText + "\n" + nick : volumeText;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,13 +140,15 @@ Item {
|
||||
if (PanelService.getPanel("audioPanel", screen)?.isPanelOpen) {
|
||||
return "";
|
||||
} else {
|
||||
I18n.tr("tooltips.volume-at", {
|
||||
"volume": (() => {
|
||||
const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0;
|
||||
const displayVolume = Math.min(maxVolume, AudioService.volume);
|
||||
return Math.round(displayVolume * 100);
|
||||
})()
|
||||
});
|
||||
const nick = AudioService.sink?.nickname ?? "";
|
||||
const volumeText = I18n.tr("tooltips.volume-at", {
|
||||
"volume": (() => {
|
||||
const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0;
|
||||
const displayVolume = Math.min(maxVolume, AudioService.volume);
|
||||
return Math.round(displayVolume * 100);
|
||||
})()
|
||||
});
|
||||
return nick ? volumeText + "\n" + nick : volumeText;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user