tony / oxwm

fixing underline width.. Browse files
tonybanters committed 2025-10-03 parent afc5578 commit a87ffc03d63ecedba76f97234792fd1950974d90
Showing 1 changed file with 8 additions and 8 deletions. UnifiedSplit
+8 −8 src/bar/bar.rs
@@ -32,7 +32,8 @@ impl Bar {
32 32 anyhow::bail!("Failed to open X11 display for XFT");
33 33 }
34 34 let font = Font::new(display, screen_num as i32, FONT)?;
35 - let height = font.height() + 4;
35 +
36 + let height = (font.height() as f32 * 1.8) as u16;
36 37
37 38 connection.create_window(
38 39 COPY_DEPTH_FROM_PARENT,
@@ -147,18 +148,17 @@ impl Bar {
147 148 let text_width = self.font.text_width(tag);
148 149 let text_x = x_position + ((tag_width - text_width) / 2) as i16;
149 150
150 - let font_height = self.font.height();
151 - let top_padding = font_height / 3;
152 - let text_y = top_padding as i16 + self.font.ascent();
151 + let top_padding = 4;
152 + let text_y = top_padding + self.font.ascent();
153 153
154 154 self.font_draw
155 155 .draw_text(&self.font, scheme.foreground, text_x, text_y, tag);
156 156
157 157 if is_selected {
158 - let underline_height = font_height / 6;
159 - let gap_between_text_and_underline = font_height / 4;
160 -
161 - let underline_y = text_y + gap_between_text_and_underline as i16;
158 + let font_height = self.font.height();
159 + let underline_height = font_height / 8;
160 + let bottom_gap = 3;
161 + let underline_y = self.height as i16 - underline_height as i16 - bottom_gap;
162 162
163 163 let underline_padding = 4;
164 164 let underline_width = tag_width - underline_padding;