mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-04-08 22:52:01 +02:00
Merge pull request #79 from Xetibo/dashie
fix: Get initial mute status for default sink and source
This commit is contained in:
commit
d468546c28
|
@ -120,6 +120,16 @@ pub fn populate_sources(input_box: Arc<SourceBox>) {
|
|||
let default_sink = input_box_imp.reset_default_source.clone();
|
||||
let source = default_sink.borrow();
|
||||
|
||||
if source.muted {
|
||||
input_box_imp
|
||||
.reset_source_mute
|
||||
.set_icon_name("microphone-disabled-symbolic");
|
||||
} else {
|
||||
input_box_imp
|
||||
.reset_source_mute
|
||||
.set_icon_name("audio-input-microphone-symbolic");
|
||||
}
|
||||
|
||||
let volume = source.volume.first().unwrap_or(&0_u32);
|
||||
let fraction = (*volume as f64 / 655.36).round();
|
||||
let percentage = (fraction).to_string() + "%";
|
||||
|
|
|
@ -119,6 +119,16 @@ pub fn populate_sinks(output_box: Arc<SinkBox>) {
|
|||
let default_sink = output_box_imp.reset_default_sink.clone();
|
||||
let sink = default_sink.borrow();
|
||||
|
||||
if sink.muted {
|
||||
output_box_imp
|
||||
.reset_sink_mute
|
||||
.set_icon_name("audio-volume-muted-symbolic");
|
||||
} else {
|
||||
output_box_imp
|
||||
.reset_sink_mute
|
||||
.set_icon_name("audio-volume-high-symbolic");
|
||||
}
|
||||
|
||||
let volume = sink.volume.first().unwrap_or(&0);
|
||||
let fraction = (*volume as f64 / 655.36).round();
|
||||
let percentage = (fraction).to_string() + "%";
|
||||
|
|
Loading…
Reference in a new issue