mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-25 10:08:33 +02:00
fix(bar): network widget spacing
This commit is contained in:
@@ -259,6 +259,7 @@ impl Network {
|
|||||||
impl BarWidget for Network {
|
impl BarWidget for Network {
|
||||||
fn render(&mut self, ctx: &Context, ui: &mut Ui, config: &mut RenderConfig) {
|
fn render(&mut self, ctx: &Context, ui: &mut Ui, config: &mut RenderConfig) {
|
||||||
if self.enable {
|
if self.enable {
|
||||||
|
// widget spacing: make sure to use the same config to call the apply_on_widget function
|
||||||
let mut render_config = config.clone();
|
let mut render_config = config.clone();
|
||||||
|
|
||||||
if self.show_total_activity || self.show_activity {
|
if self.show_total_activity || self.show_activity {
|
||||||
@@ -266,16 +267,16 @@ impl BarWidget for Network {
|
|||||||
|
|
||||||
if self.show_total_activity {
|
if self.show_total_activity {
|
||||||
for reading in total_activity {
|
for reading in total_activity {
|
||||||
config.apply_on_widget(true, ui, |ui| {
|
render_config.apply_on_widget(true, ui, |ui| {
|
||||||
ui.add(self.reading_to_label(ctx, reading, render_config.clone()));
|
ui.add(self.reading_to_label(ctx, reading, config.clone()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.show_activity {
|
if self.show_activity {
|
||||||
for reading in activity {
|
for reading in activity {
|
||||||
config.apply_on_widget(true, ui, |ui| {
|
render_config.apply_on_widget(true, ui, |ui| {
|
||||||
ui.add(self.reading_to_label(ctx, reading, render_config.clone()));
|
ui.add(self.reading_to_label(ctx, reading, config.clone()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -325,6 +326,9 @@ impl BarWidget for Network {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// widget spacing: pass on the config that was use for calling the apply_on_widget function
|
||||||
|
*config = render_config.clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user