Promote cornerRadius + focus tokens to qs.Commons.Style singleton

This commit is contained in:
Ryan Hughes
2026-05-17 23:08:08 -04:00
parent 2167bdbe95
commit 5e3659fb8d
8 changed files with 69 additions and 40 deletions
@@ -1,4 +1,5 @@
import QtQuick
import qs.Commons
// Shared visual chrome for keyboard-and-mouse-navigable items inside a panel.
// Contract: items must NOT read `containsMouse` for color/border. Mouse
@@ -14,7 +15,7 @@ Rectangle {
property color foreground: "#cacccc"
property color fill: Qt.rgba(foreground.r, foreground.g, foreground.b, 0.18)
radius: 4
radius: Style.cornerRadius
color: (hasCursor || current) ? fill : "transparent"
border.width: hasCursor ? 1 : 0
border.color: foreground
@@ -193,7 +193,7 @@ PanelWindow {
color: Color.popups.background
border.color: Color.popups.border
border.width: 2
radius: 0
radius: Style.cornerRadius
opacity: root.open ? 1.0 : 0
Behavior on opacity {
NumberAnimation { duration: 140; easing.type: Easing.OutCubic }
@@ -1,4 +1,5 @@
import QtQuick
import qs.Commons
// Small (22×22 by default) icon button used at the right edge of panel rows
// for inline actions — forget network, confirm passphrase, unpair device,
@@ -27,7 +28,7 @@ Rectangle {
implicitWidth: size
implicitHeight: size
radius: 4
radius: Style.cornerRadius
color: mouse.containsMouse && root.enabled
? Qt.rgba(hoverColor.r, hoverColor.g, hoverColor.b, 0.20)
@@ -1,5 +1,6 @@
import QtQuick
import QtQuick.Controls
import qs.Commons
Rectangle {
id: root
@@ -58,7 +59,7 @@ Rectangle {
implicitWidth: row.implicitWidth + horizontalPadding * 2
implicitHeight: row.implicitHeight + verticalPadding * 2
radius: 4
radius: Style.cornerRadius
// Hot = mouse hover OR keyboard cursor. Pressed wins over both; otherwise
// hot beats `active` (so a cursor on an already-active pill still reads
@@ -119,7 +119,7 @@ PopupWindow {
color: Color.popups.background
border.color: Color.popups.border
border.width: 2
radius: 0
radius: Style.cornerRadius
opacity: root.open ? 1.0 : 0
Behavior on opacity {