Clear data before new bar display iteration

This makes sure that data displayed is always fresh
This commit is contained in:
2025-06-07 21:19:02 -07:00
parent 4452cdbaa0
commit 79e1a5956e
10 changed files with 93 additions and 42 deletions

View File

@@ -86,13 +86,15 @@ impl Unibar {
for md in &mut self.bar_modules_enabled {
let mut mod_parts = Vec::new();
// Each bar module implements following 3 steps:
// Each bar module implements following 4 steps:
// * Clear data from previous iteration
// * Generate raw data with pertinent information
// * Return a unicode icon to be displayed
// * Return a String content to be displayed after the icon
//
// Following generates ICON+CONTENT string for a module to be displayed
// in the bar
md.clear();
md.generate_data();
mod_parts.push(md.get_icon());
mod_parts.push(md.get_content());