@@ -259,23 +259,24 @@ impl Network {
259
259
impl BarWidget for Network {
260
260
fn render ( & mut self , ctx : & Context , ui : & mut Ui , config : & mut RenderConfig ) {
261
261
if self . enable {
262
+ // widget spacing: make sure to use the same config to call the apply_on_widget function
262
263
let mut render_config = config. clone ( ) ;
263
264
264
265
if self . show_total_activity || self . show_activity {
265
266
let ( activity, total_activity) = self . network_activity ( ) ;
266
267
267
268
if self . show_total_activity {
268
269
for reading in total_activity {
269
- config . apply_on_widget ( true , ui, |ui| {
270
- ui. add ( self . reading_to_label ( ctx, reading, render_config . clone ( ) ) ) ;
270
+ render_config . apply_on_widget ( true , ui, |ui| {
271
+ ui. add ( self . reading_to_label ( ctx, reading, config . clone ( ) ) ) ;
271
272
} ) ;
272
273
}
273
274
}
274
275
275
276
if self . show_activity {
276
277
for reading in activity {
277
- config . apply_on_widget ( true , ui, |ui| {
278
- ui. add ( self . reading_to_label ( ctx, reading, render_config . clone ( ) ) ) ;
278
+ render_config . apply_on_widget ( true , ui, |ui| {
279
+ ui. add ( self . reading_to_label ( ctx, reading, config . clone ( ) ) ) ;
279
280
} ) ;
280
281
}
281
282
}
@@ -325,6 +326,9 @@ impl BarWidget for Network {
325
326
} ) ;
326
327
}
327
328
}
329
+
330
+ // widget spacing: pass on the config that was use for calling the apply_on_widget function
331
+ * config = render_config. clone ( ) ;
328
332
}
329
333
}
330
334
}
0 commit comments