diff options
Diffstat (limited to 'src/bar.rs')
| -rw-r--r-- | src/bar.rs | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -132,6 +132,21 @@ impl Bar { self.focused_window_computed = None; } + pub fn config_changed(&mut self, conn: &mut Connection<State>, shared_state: &SharedState) { + self.height = shared_state.config.height; + self.tags_computed.clear(); + self.layout_name_computed = None; + self.mode_computed = None; + self.focused_window_computed = None; + self.tray_toggle_computed = None; + self.layer_surface + .set_layer(conn, shared_state.config.layer.into()); + if !self.hidden { + self.hide(conn); + self.show(conn, shared_state); + } + } + pub fn click( &mut self, conn: &mut Connection<State>, @@ -525,7 +540,10 @@ impl Bar { let mut rendered = Vec::new(); if expanded { for item in &visible { - let label = match (cfg.show_name, cfg.show_description && !item.tooltip.is_empty()) { + let label = match ( + cfg.show_name, + cfg.show_description && !item.tooltip.is_empty(), + ) { (true, true) if item.tooltip != item.title => { format!("{} \u{2014} {}", item.title, item.tooltip) } @@ -583,7 +601,10 @@ impl Bar { let icon_w = icon.width() as f64 * scale; let icon_h = icon.height() as f64 * scale; context.save().unwrap(); - context.translate(item_x + (icon_size - icon_w) / 2.0, (full_height - icon_h) / 2.0); + context.translate( + item_x + (icon_size - icon_w) / 2.0, + (full_height - icon_h) / 2.0, + ); context.scale(scale, scale); context.set_source_surface(icon, 0.0, 0.0).unwrap(); context.paint().unwrap(); |
