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.
29 lines
1.0 KiB
QML
29 lines
1.0 KiB
QML
import QtQuick
|
|
|
|
// PillButton that participates in a panel's single-cursor model. Use
|
|
// inside a row of pills (DNS providers, bluetooth header actions, choice
|
|
// chips) where mouse hover and keyboard cursor should land in the same
|
|
// place.
|
|
//
|
|
// Caller binds `hasCursor` to the panel's cursor state and listens to
|
|
// `hovered(bool)` to update that state when the mouse enters or leaves.
|
|
// This is structurally a wrapper around PillButton with one extra
|
|
// HoverHandler — but extracting it lets every panel use the same wiring
|
|
// idiom and lets plugin authors drop into the same cursor model without
|
|
// touching internals.
|
|
//
|
|
// Why HoverHandler instead of a MouseArea overlay: HoverHandler doesn't
|
|
// steal pointer events from PillButton's internal click MouseArea, so
|
|
// clicks still reach the underlying button. An overlay MouseArea with
|
|
// acceptedButtons: Qt.NoButton works but is fragile around tooltip
|
|
// timing and event propagation.
|
|
PillButton {
|
|
id: root
|
|
|
|
signal hovered(bool isHovered)
|
|
|
|
HoverHandler {
|
|
onHoveredChanged: root.hovered(hovered)
|
|
}
|
|
}
|