mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 14:51:04 +02:00
parent
03e6f10141
commit
5e7e741842
1 changed files with 8 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
use crate::clients::volume::{self, Event};
|
use crate::clients::volume::{self, Event};
|
||||||
use crate::config::CommonConfig;
|
use crate::config::CommonConfig;
|
||||||
use crate::gtk_helpers::IronbarGtkExt;
|
use crate::gtk_helpers::{IronbarGtkExt, IronbarLabelExt};
|
||||||
use crate::modules::{
|
use crate::modules::{
|
||||||
Module, ModuleInfo, ModuleParts, ModulePopup, ModuleUpdateEvent, PopupButton, WidgetContext,
|
Module, ModuleInfo, ModuleParts, ModulePopup, ModuleUpdateEvent, PopupButton, WidgetContext,
|
||||||
};
|
};
|
||||||
|
@ -202,7 +202,13 @@ impl Module<Button> for VolumeModule {
|
||||||
where
|
where
|
||||||
<Self as Module<Button>>::SendMessage: Clone,
|
<Self as Module<Button>>::SendMessage: Clone,
|
||||||
{
|
{
|
||||||
|
let button_label = Label::builder()
|
||||||
|
.use_markup(true)
|
||||||
|
.angle(info.bar_position.get_angle())
|
||||||
|
.build();
|
||||||
|
|
||||||
let button = Button::new();
|
let button = Button::new();
|
||||||
|
button.add(&button_label);
|
||||||
|
|
||||||
{
|
{
|
||||||
let tx = context.tx.clone();
|
let tx = context.tx.clone();
|
||||||
|
@ -215,7 +221,6 @@ impl Module<Button> for VolumeModule {
|
||||||
{
|
{
|
||||||
let rx = context.subscribe();
|
let rx = context.subscribe();
|
||||||
let icons = self.icons.clone();
|
let icons = self.icons.clone();
|
||||||
let button = button.clone();
|
|
||||||
|
|
||||||
let format = self.format.clone();
|
let format = self.format.clone();
|
||||||
|
|
||||||
|
@ -227,7 +232,7 @@ impl Module<Button> for VolumeModule {
|
||||||
.replace("{percentage}", &sink.volume.to_string())
|
.replace("{percentage}", &sink.volume.to_string())
|
||||||
.replace("{name}", &sink.description);
|
.replace("{name}", &sink.description);
|
||||||
|
|
||||||
button.set_label(&label);
|
button_label.set_label_escaped(&label);
|
||||||
},
|
},
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue