Skip to content

Center bar percentage labels on their figure ink - #19075

Open
YashasVM wants to merge 1 commit into
omacom:quattrofrom
YashasVM:fix/18770-bar-label-center
Open

YashasVM wants to merge 1 commit into
omacom:quattrofrom
YashasVM:fix/18770-bar-label-center

Conversation

@YashasVM

Copy link
Copy Markdown
Contributor

What changes

The label's rounded line box and leading displaced its numeric ink from the bar icon's center. Position figures from the actual baseline and ink bounds.

Fixes #18770.

Reproduce

  1. Run the extended bar-icon geometry test against the base production source and then this commit.
  2. Render actual BarIconButton percentage labels at 13 px and 10 px using the supplied offscreen Qt fixture.
  3. Measure reference-figure ink centers against the 13 px button center and compare raster captures.

Verification

Check Before After
13 px figure-center error −0.4296875 px 0
10 px figure-center error −0.40625 px 0
Raster movement in this renderer Default digits one row higher Default moves one row; caption pixels unchanged

Focused check:

bash test/shell.d/bar-icon-geometry-test.sh

The extended geometry test fails on the base and passes in real Qt without skips. At default and caption sizes, measured figure-center errors of −0.4296875 and −0.40625 pixels become zero. Default raster digits move one row; caption raster pixels are unchanged on this renderer.

Tested commit: 2be426ca8780100958b60a9ee2dd3042216c53d2; baseline: 4bf10ed28342b597009dcf573ffc0d70b94b31e3.

Not checked / limits: Offscreen Qt 6.12 at scale 1 with JetBrainsMono Nerd Font; live Wayland, other fonts and display scales were not checked. PR #17914 explicitly excludes this component.

Combined validation is incomplete: the CLI portion of ./test/all passed, but the interrupted shell run had 11 failures whose baseline comparisons were not completed. This is not a full-suite pass.

Runtime report, commands and logs · Exact patch, focused logs and Sol review.

Screenshots

Before After
Before After

Actual BarIconButton rendered by offscreen Qt at scale 1 with synthetic percentages. Caption raster output is unchanged despite the corrected subpixel geometry.

Related

Related: #17914 changes WidgetButton and explicitly leaves BarIconButton for a separate change.

Prepared with Codex; reviewed once by gpt-6.1-sol with no actionable findings. Scoped runtime verification ran through the connected T3 Omarchy instance.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change affects the vertical placement of percentage labels in bar icons.

Complete the required live visual check before merging.

Findings

  1. P2 Live visual check is missing ▶

Summary

Centers bar percentage labels using the figures’ bounds and font ascent instead of the rounded text box.

  • Percentage digits sit centered vertically beside bar icons.

Reviews (2) · Last reviewed commit: "Center bar icon labels on their figure i..." · Reviewed by Greptile

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Nov 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reproduced on an ISO worker running this head's live shell, using the production BarIconButton in a temporary bar plugin with synthetic percentages. At 13 px and 10 px, the measured figure-center error becomes zero; restoring only the old QML brings the error back and makes the geometry test fail. At 1.25×, the default-size percentage moves up one raster row. The caption pixels stay unchanged at that scale despite corrected geometry; at 1×, the caption moves down one row. Other font families were not exercised.

./test/cli and the focused geometry test passed. The full shell run covered 427 files. After putting the worker's already-installed Node on the test PATH, all 60 dependency-affected files passed. Five other failures also reproduce on quattro: ascii, branding-about-animation, first-run (the synced worktree's Git metadata), provision-owner-keyboard, and runtime-smoke. Some hardware/environment checks skipped; there were no new suite failures.

Codex High reviewed the change and its callers. Opus 5.5 High and muse-wonder via pi, thinking high found no actionable code defect and agreed the fix is proportionate; independence is not guaranteed. No changes were pushed. Waiting for maintainer review.

Live worker bar, JetBrainsMono Nerd Font, synthetic 100% at 13 px on the left and 12% at 10 px on the right. These captures show label placement, not battery-service behavior.

Scale Before After
1× Before at 1×: caption figures sit high After at 1×: caption figures move down one row
1.25× Before at 1.25×: default percentage sits low After at 1.25×: default percentage moves up one row; caption pixels unchanged

Comment on lines +57 to +58
y: parent.height / 2 - labelMetrics.ascent
- labelMetrics.tightBoundingRect("0").top - labelMetrics.tightBoundingRect("0").height / 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Live visual check is missing. This changes where BarIconButton draws percentage labels, but the PR states that only offscreen Qt was checked. The repository requires visual changes to be verified in the running UI in addition to automated tests. Check this branch in the running desktop and attach before/after captures of the bar; offscreen component captures do not satisfy that requirement.

File Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BarIconButton labelText sits below the bar centre, under the glyph beside it

2 participants