Repository navigation
Fix lopsided cursor highlight on network panel header actions - #8787
Conversation
The QR and speed-test header buttons used raw Button components with asymmetric horizontal/vertical padding, producing a highlight box wider than tall around their near-square icons. Swap them for PanelActionButton, the canonical square inline-action component already used elsewhere in the kit (e.g. connectPwBtn), which sizes itself symmetrically around the icon. Fixes omacom#8782 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Replaces asymmetric network header buttons with canonical square action buttons to align cursor highlights.
Changes:
- Migrates QR and speed-test actions to
PanelActionButton. - Preserves existing icons, tooltips, cursor handling, and click behavior.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Reviewed at 725136e, and the fix does what it says. Reproduced on a worker. I built a Quickshell fixture from the QR and speed-test declarations in this tree's Review. The change is the right size for the problem: two elements move to Tests, on the worker. Second opinion: none. The configured reviewer, Codex Medium, answers, but its daily review budget was spent when this ran, so this review is one model's (Claude Opus 5.5). Before this can be marked ready, the second review needs to run on this head. After that, it is the maintainer's call. Nothing is needed from you. |
|
Thanks for this. Switching to
Pixel gaps between the icon ink and the highlight box (left / right / top / bottom):
Suggested change to - property real size: Math.max(Style.space(22), fontSize + Style.spacing.sm * 2)
+ property real size: Math.round(Math.max(Style.space(22), fontSize + Style.spacing.sm * 2)) Text {
textFormat: Text.PlainText
- anchors.centerIn: parent
+ // Snap to whole pixels so the glyph doesn't round away from the fill's center.
+ x: Math.round((root.width - width) / 2)
+ y: Math.round((root.height - height) / 2)Optional: these two glyphs paint an odd number of pixels wide (15 and 17px). An even 28px box therefore can't center them exactly and always leaves a 1px imbalance. Forcing an odd size (
🤖 Generated with Claude Code |
A fractional size and anchors.centerIn put the glyph on half-pixel coordinates, so it rounded a pixel off the center of the fill: the speed-test icon sat low in the network header. Round the size, make it odd so odd-width glyphs get even margins, and place the icon on whole pixels. Co-authored-by: Fabian Behrendt <7931874+fabianbehrendt@users.noreply.github.com>
…network-panel-header-action-highlight # Conflicts: # shell/Ui/PanelActionButton.qml
|
Pushed ed36f81, plus a merge of current I tested it in the real Network panel (not a fixture) on both of my screens, running stock Laptop panel, 1600×900 @ 1.25
TV, 1920×1080 @ 1
Physical pixels of fill between the icon ink and the highlight edge (inside the 1px border for
The icons no longer sit low: the worst case drops from 3px to 1px at 1.25, and from 2px to at most 1px at 1. At 1.25, the odd size also makes left and right exact. At 1 it leaves a 1px horizontal difference, as Fabian expected, since it's tuned to these glyph widths. The odd size applies to every Fabian, your separate |
|
|
Reviewed at 725136e, and the fix does what it says. Reproduced on a worker. I built a Quickshell fixture from the QR and speed-test declarations in this tree's Review. The change is the right size for the problem: two elements move to Tests, on the worker. Second opinion: none. The configured reviewer, Codex Medium, answers, but its daily review budget was spent when this ran, so this review is one model's (Claude Opus 5.5). Before this can be marked ready, the second review needs to run on this head. After that, it is the maintainer's call. Nothing is needed from you. |
|
Please disregard the comment just above. It repeated the 1 October review by mistake, and this is the review of the current head. Re-reviewed at 9887137, with the centring commit and the On a worker. I rendered the panel's own QR and speed-test actions, as each tree declares them, in a real window on an Omarchy ISO worker, with the cursor on each and JetBrainsMono Nerd Font. Then I measured the highlight box and the icon ink inside it. On Tests, on the worker. Second opinion: Codex Medium, reading the code at this head.
What it waits on. I tried to push the two-line comment fix to your branch, but GitHub refused the push. Could you change |


Summary
shell/plugins/panels/network/Panel.qml) wereButtons with asymmetric padding (horizontalPadding: Style.space(5),verticalPadding: Style.space(2)). Their keyboard/hover highlight came out taller than wide (27×33 and 29×33 at scale 1), and the icon sat off-centre horizontally (7px left / 5px right at 1.25).PanelActionButton, the kit's square inline action, as the Bluetooth row action already uses.hasCursor,hovered(bool),clicked()andtooltipTextcarry over unchanged.PanelActionButton(from @fabianbehrendt's review), the size is rounded and made odd, and the icon is placed on whole pixels withMath.roundinstead ofanchors.centerIn. Before this, a fractional size put the glyph on half-pixel coordinates, so it rounded a pixel or more off the centre of the fill, mostly low. The odd size lets odd-width glyphs get even margins. It applies to everyPanelActionButton, so the default grows from 22 to 23.As with other
PanelActionButtoncursor targets, the highlight has no 1px hover border and no separate pressed fill.Fixes #8782
Before / after
Measured in the real Network panel with the keyboard cursor on QR (left column) and speed test (right column), running each tree in place of the live shell. Physical pixels of fill between the icon ink and the highlight edge, left/right · top/bottom:
1600×900 @ 1.25
quattro(Button)PanelActionButton, unrounded1920×1080 @ 1
quattro(Button)PanelActionButton, unroundedTest plan
./test/clipassesnetwork,network-qr,network-password,border-geometry,button-border-stability,row-border-stability,bluetooth,clockandqml-text-formatshell tests pass on the branch merged with currentquattroPanelActionButton) show no layout shift againstquattroon either screen.