mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-07 04:30:55 +02:00
The wifi panel now has full keyboard nav over both sections:
h/l walk the DNS provider pills
j/k walk the wifi network list (j from DNS drops into the
list; k from the top row goes back to DNS)
Enter/Space apply the highlighted DNS provider / connect to the
highlighted wifi network
Esc close the panel
Single-cursor model. The visible cursor lives at the panel root via
focusSection + dnsIndex + selectedIndex. Mouse hover doesn't draw its
own highlight — onContainsMouseChanged on each row/pill MOVES the
cursor instead. Mouse leaving doesn't clear it (the cursor stays where
attention was last; subsequent j/k pick up from there). Last action
wins, whether mouse or keyboard.
New Common.CursorSurface holds the shared chrome (fill + 1px border +
fade) and is the base for both NetworkRow and the new local
DnsProviderPill. Items pass only hasCursor + current and let the
surface render. Contract: items never read containsMouse for visuals.
That's what guarantees exactly one highlight on screen at any time.
DnsProviderPill replaces Common.PillButton for the DNS row because
PillButton's hover > active > background cascade fights the
single-cursor model — its built-in hover would draw a parallel
highlight on whatever pill the pointer is parked on, even after the
cursor moved elsewhere. PillButton stays where it fits (refresh icon,
other bar widgets) and is unchanged here.
26 lines
783 B
QML
26 lines
783 B
QML
import QtQuick
|
|
|
|
// Shared visual chrome for keyboard-and-mouse-navigable items inside a panel.
|
|
// Contract: items must NOT read `containsMouse` for color/border. Mouse
|
|
// hover updates the panel's cursor state at the root; visuals derive from
|
|
// `hasCursor` / `current`. That's what guarantees a single highlight on
|
|
// screen at any time across both keyboard and mouse interaction.
|
|
Rectangle {
|
|
id: root
|
|
|
|
property bool hasCursor: false
|
|
property bool current: false
|
|
|
|
property color foreground: "#cacccc"
|
|
property color fill: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.18)
|
|
|
|
radius: 4
|
|
color: (hasCursor || current) ? fill : "transparent"
|
|
border.width: hasCursor ? 1 : 0
|
|
border.color: foreground
|
|
|
|
Behavior on color {
|
|
ColorAnimation { duration: 60 }
|
|
}
|
|
}
|