Repository navigation
Conversation
The clock cell was a fixed 96 px, so "10:07" over "2026/11/24" got 17 px of air on both sides while the bar gave the block 5 px above and below, and the hover pill looked like a letterbox around it. The cell is measured from the two lines in the bar's own fonts now, the same CLOCK_PAD on both sides, with CLOCK_MIN for a short date. The right group reserved 150 px (216 with a battery) but drew the language label, the wifi and the volume in 96: the rest was a hole between the volume icon and the clock (71 px at 200 % here) that also opened the battery panel on a click. Its width is added up from the SYS_* slots paint() draws at, and hit() reads the same slots. Side bar: the clock lines are drawn inside the cell instead of the whole bar width, like the bottom bar. Tests: the cell fits every locale's short date (en-US, ru-RU, ja-JP, pt-BR, zh-CN at 200 %), and the group's width equals what it draws, with and without a battery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the spacing around the clock at the right end of the bar.
The clock cell. It was a fixed 96 px. "10:07" over "2026/11/24" sat in it with 17 px of air left and right, while the bar gave the block 5 px above and below, so the block floated and the hover pill looked like a letterbox around it. The cell is measured now from the two lines in the bar's own fonts (the same
bar_fonts()the painter uses), withCLOCK_PAD(10 px) on both sides andCLOCK_MIN(72 px) so a short date like "1/1/2026" does not make it hug its edges. A locale's date widens the cell instead of being ellipsized.The right group.
layout()reserved 150 px for the language label + wifi + volume (216 with a battery) butpaint()drew them in 96: the rest was a hole between the volume icon and the clock — 71 px on this machine, which runs at 200 % scaling — and a click in the hole opened the battery panel. The width is added up now from the sameSYS_*slots the painter draws at, andhit()reads those slots as well.Measured on a 3840 px wide bar at 200 % (physical pixels, ink to ink):
Side bar: the clock lines are drawn inside their cell instead of the whole bar width, like the bottom bar.
Tests (
cargo test -p topbar, 16 pass):clock_cell_fits_every_locale— the short time and short date of en-US, ru-RU, ja-JP, pt-BR and zh-CN at 200 % both fit the cell with the padding on each side, and the cell never drops belowCLOCK_MIN.system_group_is_as_wide_as_it_draws— the group's width equals its slots, with and without a battery.