1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-04-19 19:34:24 +02:00

Merge pull request #586 from JakeStanger/feat/label-markup

Add pango markup support to remaining locations
This commit is contained in:
Jake Stanger 2024-05-11 20:47:44 +01:00 committed by GitHub
commit f78a062f3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -44,7 +44,7 @@ pub fn new_icon_label(input: &str, icon_theme: &IconTheme, size: i32) -> gtk::Bo
ImageProvider::parse(input, icon_theme, false, size) ImageProvider::parse(input, icon_theme, false, size)
.map(|provider| provider.load_into_image(image)); .map(|provider| provider.load_into_image(image));
} else { } else {
let label = Label::new(Some(input)); let label = Label::builder().use_markup(true).label(input).build();
label.add_class("icon"); label.add_class("icon");
label.add_class("text-icon"); label.add_class("text-icon");

View file

@ -191,6 +191,7 @@ impl Module<Button> for MusicModule {
let icon_pause = new_icon_label(&self.icons.pause, info.icon_theme, self.icon_size); let icon_pause = new_icon_label(&self.icons.pause, info.icon_theme, self.icon_size);
let label = Label::new(None); let label = Label::new(None);
label.set_use_markup(true);
label.set_angle(info.bar_position.get_angle()); label.set_angle(info.bar_position.get_angle());
if let Some(truncate) = self.truncate { if let Some(truncate) = self.truncate {
@ -544,7 +545,14 @@ impl IconLabel {
let container = gtk::Box::new(Orientation::Horizontal, 5); let container = gtk::Box::new(Orientation::Horizontal, 5);
let icon = new_icon_label(icon_input, icon_theme, 24); let icon = new_icon_label(icon_input, icon_theme, 24);
let label = Label::new(label);
let mut builder = Label::builder().use_markup(true);
if let Some(label) = label {
builder = builder.label(label);
}
let label = builder.build();
icon.add_class("icon-box"); icon.add_class("icon-box");
label.add_class("label"); label.add_class("label");