fix(layout): refine tab indicator sizing and theme styling

This commit is contained in:
Samuel Onoja committed 2026-10-13 00:21:10 +01:00
1 parent 042698ea61
commit eaeabebe73
9 files changed
+135 -35

No files matched your search

+14
View File
@@ -576,6 +576,20 @@ impl Ferese {
Some(buffer)
}
pub(crate) fn indicator_text_width(&self, text: &str, size: f64) -> f64 {
let chars = text.chars().filter(|c| !c.is_control());
if let Some(font) = self.overview.font.as_ref() {
let scaled = font.as_scaled(size as f32);
chars
.map(|c| f64::from(scaled.h_advance(font.glyph_id(c))))
.sum::<f64>()
.ceil()
+ 4.0
} else {
chars.count() as f64 * size * 0.65 + 4.0
}
}
pub(crate) fn indicator_label(
&mut self,
text: &str,