fix(gui): the tab strip's width is folded, not summed, so kernel-only passes
scripts/raw-decimal-arith.sh refuses an Iterator::sum of any type (it cannot tell widths from money without types it does not have). The tab widths are f32 layout, no money; a fold says the same and the check reads 0 places. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
13e676a101
commit
e42c3909fa
1 file changed
+4
-2
@@ -176,8 +176,10 @@ impl TabBar {
|
||||
// when they don't fit, the "+" stays at the right edge
|
||||
// and the tabs scroll.
|
||||
let widths: Vec<f32> = tabs.iter().map(|t| tab_width(ui, t)).collect();
|
||||
let total: f32 =
|
||||
widths.iter().sum::<f32>() + widths.len().saturating_sub(1) as f32 * TAB_GAP;
|
||||
// A fold, not `sum`: the kernel-only check refuses an
|
||||
// `Iterator::sum` of any type, and these are widths.
|
||||
let total: f32 = widths.iter().fold(0.0, |w, t| w + t)
|
||||
+ widths.len().saturating_sub(1) as f32 * TAB_GAP;
|
||||
let room = (ui.available_width() - PLUS_W - PLUS_GAP).max(0.0);
|
||||
let strip_w = total.min(room);
|
||||
let strip = egui::Rect::from_min_size(bar.min, vec2(strip_w, bar.height()));
|
||||
|
||||
Reference in new issue
Block a user