diff --git a/src/app.rs b/src/app.rs --- a/src/app.rs +++ b/src/app.rs @@ -539,7 +539,7 @@ ) { const NAME_W: f32 = 140.0; const WRITE_W: f32 = 100.0; - const FREQ_W: f32 = 90.0; + const FREQ_W: f32 = 80.0; let name_style = |s: &str| { if is_header { @@ -565,17 +565,22 @@ .color(th.palette.text_secondary) } }; - let metric_style = |s: &str| { - if is_header { - RichText::new(s) - .size(th.type_scale.caption) - .strong() - .color(th.palette.text_secondary) + // Monospace metrics so column edges stay vertical (no length "waterfall"). + let metric = |s: &str, secondary: bool| { + let color = if is_header { + th.palette.text_secondary + } else if secondary { + th.palette.text_secondary } else { - RichText::new(s) - .size(th.type_scale.body) - .color(th.palette.text) + th.palette.text + }; + let mut rt = RichText::new(s).size(th.type_scale.caption).color(color); + if is_header { + rt = rt.strong(); + } else { + rt = rt.monospace(); } + rt }; let name_label = if is_header { @@ -601,22 +606,23 @@ egui::Label::new(path_style(&path_label)).truncate(), ); - ui.add_sized( - [WRITE_W, row_h], - egui::Label::new(metric_style(write)).halign(Align::RIGHT), + // Right-to-left layout actually pins text to the column's right edge; + // Label::halign alone does not (text stayed left → staircase edge). + ui.allocate_ui_with_layout( + egui::vec2(WRITE_W, row_h), + Layout::right_to_left(Align::Center), + |ui| { + ui.set_min_width(WRITE_W); + ui.label(metric(write, false)); + }, ); - ui.add_sized( - [FREQ_W, row_h], - egui::Label::new( - if is_header { - metric_style(freq) - } else { - RichText::new(freq) - .size(th.type_scale.body) - .color(th.palette.text_secondary) - }, - ) - .halign(Align::RIGHT), + ui.allocate_ui_with_layout( + egui::vec2(FREQ_W, row_h), + Layout::right_to_left(Align::Center), + |ui| { + ui.set_min_width(FREQ_W); + ui.label(metric(freq, true)); + }, ); }