From ac34c05d2ecb07fd871ed03ef6ee545dc2e6743d Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sat, 17 Jun 2023 16:43:38 +0100 Subject: [PATCH] fix(focused): empty icon rendered when `show_icon = false` Fixes #184 --- src/modules/focused.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/focused.rs b/src/modules/focused.rs index 3a4933a..4eb0342 100644 --- a/src/modules/focused.rs +++ b/src/modules/focused.rs @@ -97,7 +97,10 @@ impl Module for FocusedModule { let container = gtk::Box::new(info.bar_position.get_orientation(), 5); let icon = gtk::Image::new(); - add_class(&icon, "icon"); + if self.show_icon { + add_class(&icon, "icon"); + container.add(&icon); + } let label = Label::new(None); add_class(&label, "label"); @@ -106,7 +109,6 @@ impl Module for FocusedModule { truncate.truncate_label(&label); } - container.add(&icon); container.add(&label); {