Standardize cursor chrome to fill-only across qs.Ui

CursorSurface defines the canonical cursor chrome: a tinted fill, no
border. Three components had inconsistent treatments that the recent
standardization pass left half-finished:

- PillButton kept a 1px foreground border on hot (cursor or hover)
  via a cursorBordered: true default.
- CursorPill specifically had to override cursorBordered: false to
  match the rest of the kit.
- ChoiceButton thickened its border to 2px on hasCursor, which mixed
  the cursor visual with the Tab-focus visual.

Drop the cursorBordered escape hatch from PillButton (no caller other
than CursorPill ever used it), drop CursorPill's now-redundant
override, and remove hasCursor from ChoiceButton's border.width
thickening. Update Toggle's class comment (it still claimed cursor
mirrored Tab focus, which f3ba5055 broke without updating the doc).

Now: hot/hasCursor = fill only, activeFocus = accent border ring,
selected/active = stronger fill or accent border per component
semantic. One canonical pattern across the kit.
This commit is contained in:
Ryan Hughes committed 2026-05-18 11:52:23 -04:00
1 parent 648bc54db1
commit 42dee4d399
4 files changed
+15 -14

No files matched your search

+4 -3
View File
@@ -18,8 +18,9 @@ Rectangle {
// Panel-cursor flag. Same role as PillButton.hasCursor: panels that own
// their own cursor state bind this to drive the keyboard highlight
// separately from real activeFocus. Visuals match the activeFocus look
// (foreground 2px border) so cursor and Tab focus read the same.
// separately from real activeFocus. Cursor renders as a fill only —
// CursorSurface is the canonical chrome — while Tab focus adds the
// accent border ring on top.
property bool hasCursor: false
property bool borderlessHighlight: false
@@ -48,7 +49,7 @@ Rectangle {
? accent
: (activeFocus ? foreground : Qt.rgba(foreground.r, foreground.g, foreground.b, 0.4))
border.width: borderlessHighlight ? (activeFocus ? 2 : 0)
: (selected ? 2 : (activeFocus || hasCursor ? 2 : 1))
: (selected ? 2 : (activeFocus ? 2 : 1))
Behavior on color { ColorAnimation { duration: 100 } }