tab bar: force x and + buttons to be square

Use the font height as the basis for the size, rather than the width,
to avoid the buttons being too condensed.

Explicitly use the pixel height for the dimensions so that the
buttons are square.

refs: https://github.com/wez/wezterm/issues/2399
This commit is contained in:
Wez Furlong committed 2022-08-20 22:34:19 -07:00
1 parent b181935303
commit 3917fc2184
1 file changed
+8 -4
+8 -4
View File
@@ -553,8 +553,8 @@ impl super::TermWindow {
line_width: metrics.underline_height.max(2),
poly: SizedPoly {
poly: PLUS_BUTTON,
width: Dimension::Pixels(metrics.cell_size.width as f32 * 0.75),
height: Dimension::Pixels(metrics.cell_size.width as f32 * 0.75),
width: Dimension::Pixels(metrics.cell_size.height as f32 / 2.),
height: Dimension::Pixels(metrics.cell_size.height as f32 / 2.),
},
},
)
@@ -733,8 +733,12 @@ impl super::TermWindow {
line_width: metrics.underline_height.max(2),
poly: SizedPoly {
poly: X_BUTTON,
width: Dimension::Cells(0.5),
height: Dimension::Cells(0.5),
width: Dimension::Pixels(
metrics.cell_size.height as f32 / 2.,
),
height: Dimension::Pixels(
metrics.cell_size.height as f32 / 2.,
),
},
},
)