Qualify shell palette references for Qt 6.12 (#14553)

This commit is contained in:
David Heinemeier Hansson authored and GitHub committed 2026-10-08 10:27:08 +02:00
1 parent 902fd8aebd
commit b83d3df084
74 files changed
+381 -293

No files matched your search

+4
View File
@@ -45,3 +45,7 @@ unicode characters. Agent file-editing tools can strip multi-byte codepoints
in some positions — do **not** rewrite widget files wholesale through those in some positions — do **not** rewrite widget files wholesale through those
tools. For glyph fixes, make a targeted edit with the surrounding context, or tools. For glyph fixes, make a targeted edit with the surrounding context, or
use a Python script that inserts codepoints via `chr(0xXXXXX)`. use a Python script that inserts codepoints via `chr(0xXXXXX)`.
## Palette references
Import `qs.Commons as Commons` and use `Commons.Color` for the palette singleton, including `Connections.target`. Qt 6.12 introduces a `Color` type in `QtQuick` that shadows unqualified palette references. This applies to first-party components and third-party plugin QML alike. Keep the unqualified `qs.Commons` import when the file also uses `Style`, `Util`, or `Border`.
+21 -7
View File
@@ -189,6 +189,20 @@ overrides like `omarchy display text size` survive theme switches.
## Theme tokens ## Theme tokens
Shell and plugin QML must qualify the palette singleton because Qt 6.12 introduces its own `Color` type. Import `qs.Commons` with an alias and use `Commons.Color` for palette properties and signal connections:
```qml
import QtQuick
import qs.Commons
import qs.Commons as Commons
Rectangle {
color: Commons.Color.background
}
```
The unqualified import can remain for `Style`, `Util`, and `Border`. Existing third-party plugins that use bare `Color` must make the same change; fixing the host shell does not change a plugin's import scope.
See [`theming.md`](theming.md) for the full theme/template workflow, See [`theming.md`](theming.md) for the full theme/template workflow,
including generated `*.tpl` files, gradient helpers, and shell border syntax. including generated `*.tpl` files, gradient helpers, and shell border syntax.
@@ -200,17 +214,17 @@ or override a single section with `shell.<section>.toml`, merged in by
`omarchy-theme-set-templates` (see [`theming.md`](theming.md)). `omarchy-theme-set-templates` (see [`theming.md`](theming.md)).
`colors.toml` uses `foreground` and `background` for the foundational `colors.toml` uses `foreground` and `background` for the foundational
text/background palette, exposed to QML as `Color.foreground` and text/background palette, exposed to QML as `Commons.Color.foreground` and
`Color.background`. `Commons.Color.background`.
The shell exposes these tokens to QML via three singletons in The shell exposes these tokens to QML via three singletons in
`qs.Commons`: `qs.Commons`:
- `Color` — palette (`foreground`, `background`, `accent`, `urgent`) - `Color` — palette (`foreground`, `background`, `accent`, `urgent`)
and per-surface roles (`Color.bar.*`, `Color.popups.*`, and per-surface roles (`Commons.Color.bar.*`, `Commons.Color.popups.*`,
`Color.tooltip.*`, `Color.notifications.*`, `Color.menu.*`, `Commons.Color.tooltip.*`, `Commons.Color.notifications.*`, `Commons.Color.menu.*`,
`Color.polkit.*`, `Color.lock.*`, `Color.imagePicker.*`). Clipboard `Commons.Color.polkit.*`, `Commons.Color.lock.*`, `Commons.Color.imagePicker.*`). Clipboard
and emojis share `Color.menu.*`; the `[launcher]` section is consumed and emojis share `Commons.Color.menu.*`; the `[launcher]` section is consumed
by the launcher outside shell QML. by the launcher outside shell QML.
- `Style` — structural tokens (`cornerRadius`), shared interactive - `Style` — structural tokens (`cornerRadius`), shared interactive
state tokens/helpers, spacing (`Style.spacing.*` / `Style.space(px)`), state tokens/helpers, spacing (`Style.spacing.*` / `Style.space(px)`),
@@ -218,7 +232,7 @@ The shell exposes these tokens to QML via three singletons in
(`Style.bar.sizeHorizontal` / `Style.bar.sizeVertical`). (`Style.bar.sizeHorizontal` / `Style.bar.sizeVertical`).
- `Border` — border-spec helpers for QML surfaces. Use with - `Border` — border-spec helpers for QML surfaces. Use with
`BorderSurface` from `qs.Ui` when a border should honor shell theme `BorderSurface` from `qs.Ui` when a border should honor shell theme
gradients or per-side widths. `Color.<section>.border` is only the gradients or per-side widths. `Commons.Color.<section>.border` is only the
flat-color fallback for code that cannot render a real border. flat-color fallback for code that cannot render a real border.
### Interactive states ### Interactive states
+5 -4
View File
@@ -197,7 +197,7 @@ The filename decides the target section, so the `[lock]` header is optional.
The running shell reads `shell.toml` into two QML singletons: The running shell reads `shell.toml` into two QML singletons:
- `Color` for palette and surface roles like `Color.menu.border`. - `Color` for palette and surface roles like `Commons.Color.menu.border`.
- `Style` for controls, spacing, font scale, corner radius, and bar sizing. - `Style` for controls, spacing, font scale, corner radius, and bar sizing.
### Borders ### Borders
@@ -326,11 +326,12 @@ Plugin and shell QML should use `BorderSurface` for theme-aware borders:
```qml ```qml
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
BorderSurface { BorderSurface {
color: Color.popups.background color: Commons.Color.popups.background
borderSpec: Border.surfaceSpec("popups", "border", Color.popups.border, 2) borderSpec: Border.surfaceSpec("popups", "border", Commons.Color.popups.border, 2)
padding: Style.spacing.popupPadding padding: Style.spacing.popupPadding
Item { Item {
@@ -347,7 +348,7 @@ Use `Border.surfaceSpec(section, token, fallbackColor, fallbackWidth, alphaKey)`
for shell theme tokens (the optional `alphaKey` names the alpha token, e.g. for shell theme tokens (the optional `alphaKey` names the alpha token, e.g.
`"border-alpha"`), `Border.controlSpec(state, foreground, accent, urgent)` for `"border-alpha"`), `Border.controlSpec(state, foreground, accent, urgent)` for
shared controls, and `Border.flat(color, width)` for a deliberate local border shared controls, and `Border.flat(color, width)` for a deliberate local border
that should not be overridden by the active theme. `Color.<section>.border` is the that should not be overridden by the active theme. `Commons.Color.<section>.border` is the
flat first-stop color for consumers that cannot render full border specs. flat first-stop color for consumers that cannot render full border specs.
## Hyprland templates ## Hyprland templates
+7 -6
View File
@@ -1,5 +1,6 @@
pragma Singleton pragma Singleton
import QtQuick import QtQuick
import qs.Commons as Commons
import "BorderGeometry.js" as Geometry import "BorderGeometry.js" as Geometry
// Central border-spec factory for shell surfaces and controls. A spec carries // Central border-spec factory for shell surfaces and controls. A spec carries
@@ -22,7 +23,7 @@ QtObject {
} }
function value(section, key) { function value(section, key) {
var v = Color.shellValues[section + "." + key] var v = Commons.Color.shellValues[section + "." + key]
return (v === undefined || v === null) ? "" : v return (v === undefined || v === null) ? "" : v
} }
@@ -39,7 +40,7 @@ QtObject {
var seen = {} var seen = {}
while (s.match(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/) && !seen[s]) { while (s.match(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/) && !seen[s]) {
seen[s] = true seen[s] = true
var next = Color.shellValues[s] var next = Commons.Color.shellValues[s]
if (next === undefined || next === null || String(next).length === 0) break if (next === undefined || next === null || String(next).length === 0) break
s = String(next).replace(/^\s+|\s+$/g, "") s = String(next).replace(/^\s+|\s+$/g, "")
} }
@@ -68,10 +69,10 @@ QtObject {
var s = String(color || "").replace(/^\s+|\s+$/g, "") var s = String(color || "").replace(/^\s+|\s+$/g, "")
var role = s.toLowerCase() var role = s.toLowerCase()
if (role === "foreground" || role === "text") return cssColor(Color.foreground, a) if (role === "foreground" || role === "text") return cssColor(Commons.Color.foreground, a)
if (role === "accent") return cssColor(Color.accent, a) if (role === "accent") return cssColor(Commons.Color.accent, a)
if (role === "urgent") return cssColor(Color.urgent, a) if (role === "urgent") return cssColor(Commons.Color.urgent, a)
if (role === "background") return cssColor(Color.background, a) if (role === "background") return cssColor(Commons.Color.background, a)
if (role === "transparent") return "transparent" if (role === "transparent") return "transparent"
return Geometry.canonicalColor(s, a) return Geometry.canonicalColor(s, a)
} }
+22 -21
View File
@@ -1,5 +1,6 @@
pragma Singleton pragma Singleton
import QtQuick import QtQuick
import qs.Commons as Commons
import Quickshell import Quickshell
import Quickshell.Hyprland import Quickshell.Hyprland
import Quickshell.Io import Quickshell.Io
@@ -114,27 +115,27 @@ QtObject {
} }
function resolveStateColor(token, foreground, accent, urgent, fallback) { function resolveStateColor(token, foreground, accent, urgent, fallback) {
var fb = fallback || foreground || Color.foreground var fb = fallback || foreground || Commons.Color.foreground
var s = String(token || "").replace(/^\s+|\s+$/g, "") var s = String(token || "").replace(/^\s+|\s+$/g, "")
var role = s.toLowerCase() var role = s.toLowerCase()
if (role === "foreground" || role === "text") return foreground || Color.foreground if (role === "foreground" || role === "text") return foreground || Commons.Color.foreground
if (role === "accent") return accent || Color.accent if (role === "accent") return accent || Commons.Color.accent
if (role === "urgent") return urgent || Color.urgent if (role === "urgent") return urgent || Commons.Color.urgent
if (role === "background") return Color.background if (role === "background") return Commons.Color.background
if (role === "transparent") return Qt.rgba(0, 0, 0, 0) if (role === "transparent") return Qt.rgba(0, 0, 0, 0)
return colorFromHex(s, fb) return colorFromHex(s, fb)
} }
function normalStateColor(foreground, accent, urgent) { function normalStateColor(foreground, accent, urgent) {
return resolveStateColor(normalColorToken, foreground, accent, urgent, foreground || Color.foreground) return resolveStateColor(normalColorToken, foreground, accent, urgent, foreground || Commons.Color.foreground)
} }
function hoverStateColor(foreground, accent, urgent) { function hoverStateColor(foreground, accent, urgent) {
return resolveStateColor(hoverColorToken, foreground, accent, urgent, foreground || Color.foreground) return resolveStateColor(hoverColorToken, foreground, accent, urgent, foreground || Commons.Color.foreground)
} }
function selectedStateColor(foreground, accent, urgent) { function selectedStateColor(foreground, accent, urgent) {
return resolveStateColor(selectedColorToken, foreground, accent, urgent, foreground || Color.foreground) return resolveStateColor(selectedColorToken, foreground, accent, urgent, foreground || Commons.Color.foreground)
} }
function pressedStateColor(foreground, accent, urgent) { function pressedStateColor(foreground, accent, urgent) {
@@ -149,7 +150,7 @@ QtObject {
} }
function selectionStateColor(foreground, accent, urgent) { function selectionStateColor(foreground, accent, urgent) {
return resolveStateColor(selectionColorToken, foreground, accent, urgent, foreground || Color.foreground) return resolveStateColor(selectionColorToken, foreground, accent, urgent, foreground || Commons.Color.foreground)
} }
function normalFillFor(foreground, accent, urgent) { return Util.alpha(normalStateColor(foreground, accent, urgent), normalFillAlpha) } function normalFillFor(foreground, accent, urgent) { return Util.alpha(normalStateColor(foreground, accent, urgent), normalFillAlpha) }
@@ -187,17 +188,17 @@ QtObject {
} }
// Convenience colors resolved against the foundational palette. // Convenience colors resolved against the foundational palette.
readonly property color normalFill: normalFillFor(Color.foreground, Color.accent, Color.urgent) readonly property color normalFill: normalFillFor(Commons.Color.foreground, Commons.Color.accent, Commons.Color.urgent)
readonly property color hoverFill: hoverFillFor(Color.foreground, Color.accent, Color.urgent) readonly property color hoverFill: hoverFillFor(Commons.Color.foreground, Commons.Color.accent, Commons.Color.urgent)
readonly property color selectedFill: selectedFillFor(Color.foreground, Color.accent, Color.urgent) readonly property color selectedFill: selectedFillFor(Commons.Color.foreground, Commons.Color.accent, Commons.Color.urgent)
readonly property color pressedFill: pressedFillFor(Color.foreground, Color.accent, Color.urgent) readonly property color pressedFill: pressedFillFor(Commons.Color.foreground, Commons.Color.accent, Commons.Color.urgent)
readonly property color focusFillColor: focusFillFor(Color.foreground, Color.accent, Color.urgent) readonly property color focusFillColor: focusFillFor(Commons.Color.foreground, Commons.Color.accent, Commons.Color.urgent)
readonly property color normalBorderColor: normalBorderFor(Color.foreground, Color.accent, Color.urgent) readonly property color normalBorderColor: normalBorderFor(Commons.Color.foreground, Commons.Color.accent, Commons.Color.urgent)
readonly property color hoverBorderColor: hoverBorderFor(Color.foreground, Color.accent, Color.urgent) readonly property color hoverBorderColor: hoverBorderFor(Commons.Color.foreground, Commons.Color.accent, Commons.Color.urgent)
readonly property color selectedBorderColor: selectedBorderFor(Color.foreground, Color.accent, Color.urgent) readonly property color selectedBorderColor: selectedBorderFor(Commons.Color.foreground, Commons.Color.accent, Commons.Color.urgent)
readonly property color focusBorderColor: focusBorderFor(Color.foreground, Color.accent, Color.urgent) readonly property color focusBorderColor: focusBorderFor(Commons.Color.foreground, Commons.Color.accent, Commons.Color.urgent)
readonly property color selectedAccentFill: Util.alpha(Color.accent, selectedFillAlpha) readonly property color selectedAccentFill: Util.alpha(Commons.Color.accent, selectedFillAlpha)
readonly property color selectionFill: selectionFillFor(Color.foreground, Color.accent, Color.urgent) readonly property color selectionFill: selectionFillFor(Commons.Color.foreground, Commons.Color.accent, Commons.Color.urgent)
// ---------------------------------------------------------- spacing // ---------------------------------------------------------- spacing
// //
@@ -390,7 +391,7 @@ QtObject {
} }
// Pull typography, bar dimensions, state tokens, and spacing out of the // Pull typography, bar dimensions, state tokens, and spacing out of the
// shell.toml dict that Color already parsed. Called by Color.loadShell so // shell.toml dict that Color already parsed. Called by Commons.Color.loadShell so
// a single parse pass feeds both singletons. // a single parse pass feeds both singletons.
function applyShellValues(values) { function applyShellValues(values) {
var fontOut = {} var fontOut = {}
+7 -6
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import qs.Commons import qs.Commons
import qs.Commons as Commons
// The button. One component for every clickable thing in the kit. // The button. One component for every clickable thing in the kit.
// States compose independently and are applied in priority order: // States compose independently and are applied in priority order:
@@ -32,9 +33,9 @@ BorderSurface {
property bool bordered: false property bool bordered: false
// Colors. Defaults track the theme; per-instance overrides are honored. // Colors. Defaults track the theme; per-instance overrides are honored.
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color background: "transparent" property color background: "transparent"
property color accent: Color.accent property color accent: Commons.Color.accent
// Sizing. // Sizing.
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
@@ -54,9 +55,9 @@ BorderSurface {
// Tooltip palette. Auto-rendered if tooltipText is set. Defaults pull // Tooltip palette. Auto-rendered if tooltipText is set. Defaults pull
// from [tooltip] in shell.toml; override per-instance only when a button // from [tooltip] in shell.toml; override per-instance only when a button
// intentionally wants a tooltip that diverges from the theme. // intentionally wants a tooltip that diverges from the theme.
property color tooltipBackground: Color.tooltip.background property color tooltipBackground: Commons.Color.tooltip.background
property color tooltipForeground: Color.tooltip.text property color tooltipForeground: Commons.Color.tooltip.text
property color tooltipBorder: Color.tooltip.border property color tooltipBorder: Commons.Color.tooltip.border
signal clicked() signal clicked()
signal rightClicked() signal rightClicked()
@@ -77,7 +78,7 @@ BorderSurface {
readonly property bool hot: mouseArea.containsMouse || hasCursor readonly property bool hot: mouseArea.containsMouse || hasCursor
readonly property bool _showFocusRing: focusable && activeFocus readonly property bool _showFocusRing: focusable && activeFocus
readonly property color _selectedColor: Style.selectedStateColor(root.foreground, root.accent) readonly property color _selectedColor: Style.selectedStateColor(root.foreground, root.accent)
readonly property var _tooltipBorderSpec: Border.localOrSurfaceSpec("tooltip", "border", root.tooltipBorder, Color.tooltip.border, Math.max(1, Style.normalBorderWidth)) readonly property var _tooltipBorderSpec: Border.localOrSurfaceSpec("tooltip", "border", root.tooltipBorder, Commons.Color.tooltip.border, Math.max(1, Style.normalBorderWidth))
readonly property var _focusBorderSpec: Border.controlSpec("focus", root.foreground, root.accent) readonly property var _focusBorderSpec: Border.controlSpec("focus", root.foreground, root.accent)
readonly property var _hoverBorderSpec: Border.controlSpec("hover-cursor", root.foreground, root.accent) readonly property var _hoverBorderSpec: Border.controlSpec("hover-cursor", root.foreground, root.accent)
readonly property var _selectedBorderSpec: Border.controlSpec("selected", root.foreground, root.accent) readonly property var _selectedBorderSpec: Border.controlSpec("selected", root.foreground, root.accent)
+4 -3
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Mutually-exclusive row of Buttons — the form-style "pick one of N" // Mutually-exclusive row of Buttons — the form-style "pick one of N"
// pattern (bar position top/right/bottom/left, theme preset chips, etc.). // pattern (bar position top/right/bottom/left, theme preset chips, etc.).
@@ -25,9 +26,9 @@ Row {
property var options: [] property var options: []
property string value: "" property string value: ""
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color background: Color.background property color background: Commons.Color.background
property color accent: Color.accent property color accent: Commons.Color.accent
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property real fontSize: Style.font.body property real fontSize: Style.font.body
property bool focusable: true property bool focusable: true
+9 -8
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
Item { Item {
id: root id: root
@@ -9,11 +10,11 @@ Item {
property string cancelText: "Cancel" property string cancelText: "Cancel"
property string confirmText: "Confirm" property string confirmText: "Confirm"
property int selectedIndex: 1 property int selectedIndex: 1
property color background: Color.background property color background: Commons.Color.background
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color scrim: Util.alpha(Color.background, 0.7) property color scrim: Util.alpha(Commons.Color.background, 0.7)
property color selectedBackground: Util.alpha(Color.foreground, 0.08) property color selectedBackground: Util.alpha(Commons.Color.foreground, 0.08)
property color selectedText: Color.accent property color selectedText: Commons.Color.accent
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property int cornerRadius: Style.cornerRadius property int cornerRadius: Style.cornerRadius
@@ -98,10 +99,10 @@ Item {
width: Style.space(88) width: Style.space(88)
height: Style.space(34) height: Style.space(34)
color: selected color: selected
? (destructive ? Util.alpha(Color.urgent, 0.22) : root.selectedBackground) ? (destructive ? Util.alpha(Commons.Color.urgent, 0.22) : root.selectedBackground)
: "transparent" : "transparent"
borderSpec: Border.flat(destructive borderSpec: Border.flat(destructive
? (selected ? Color.urgent : Util.alpha(Color.urgent, 0.56)) ? (selected ? Commons.Color.urgent : Util.alpha(Commons.Color.urgent, 0.56))
: (selected ? root.selectedText : Util.alpha(root.foreground, 0.38)), Style.normalBorderWidth) : (selected ? root.selectedText : Util.alpha(root.foreground, 0.38)), Style.normalBorderWidth)
radius: 0 radius: 0
@@ -109,7 +110,7 @@ Item {
textFormat: Text.PlainText textFormat: Text.PlainText
anchors.centerIn: parent anchors.centerIn: parent
text: modelData text: modelData
color: destructive ? (selected ? Color.urgent : root.foreground) : (selected ? root.selectedText : root.foreground) color: destructive ? (selected ? Commons.Color.urgent : root.foreground) : (selected ? root.selectedText : root.foreground)
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.caption font.pixelSize: Style.font.caption
} }
+3 -2
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Shared visual chrome for keyboard-and-mouse-navigable items inside a panel. // Shared visual chrome for keyboard-and-mouse-navigable items inside a panel.
// Contract: items must NOT read `containsMouse` for color/border. Mouse // Contract: items must NOT read `containsMouse` for color/border. Mouse
@@ -19,8 +20,8 @@ BorderSurface {
property bool outline: false property bool outline: false
property bool bordered: false property bool bordered: false
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color accent: Color.accent property color accent: Commons.Color.accent
property color fill: Style.hoverFillFor(foreground, accent) property color fill: Style.hoverFillFor(foreground, accent)
property color currentFill: Style.selectedFillFor(foreground, accent) property color currentFill: Style.selectedFillFor(foreground, accent)
+8 -7
View File
@@ -1,10 +1,11 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Themed single-select dropdown. Trigger row paints with the kit's focus // Themed single-select dropdown. Trigger row paints with the kit's focus
// chrome; the popup anchors below and uses Color.popups.background + // chrome; the popup anchors below and uses Commons.Color.popups.background +
// Color.popups.border so it reads as a panel surface rather than the // Commons.Color.popups.border so it reads as a panel surface rather than the
// platform-native ComboBox look. // platform-native ComboBox look.
// //
// `options` accepts either a plain string[] or an array of // `options` accepts either a plain string[] or an array of
@@ -22,11 +23,11 @@ Item {
property string value: "" property string value: ""
property var options: [] property var options: []
property color foreground: Color.popups.text property color foreground: Commons.Color.popups.text
property color background: Color.popups.background property color background: Commons.Color.popups.background
property color popupBorder: Color.popups.border property color popupBorder: Commons.Color.popups.border
property color accent: Color.accent property color accent: Commons.Color.accent
readonly property var popupBorderSpec: Border.localOrSurfaceSpec("popups", "border", popupBorder, Color.popups.border, Style.normalBorderWidth) readonly property var popupBorderSpec: Border.localOrSurfaceSpec("popups", "border", popupBorder, Commons.Color.popups.border, Style.normalBorderWidth)
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property int rowHeight: Style.spacing.controlHeight property int rowHeight: Style.spacing.controlHeight
property int popupRowHeight: Style.spacing.popupRowHeight property int popupRowHeight: Style.spacing.popupRowHeight
+3 -2
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Layer-shell popup attached to a bar widget icon, designed for // Layer-shell popup attached to a bar widget icon, designed for
// click-driven AND keyboard-driven panels (e.g. SUPER+CTRL+W summon). // click-driven AND keyboard-driven panels (e.g. SUPER+CTRL+W summon).
@@ -44,7 +45,7 @@ PanelWindow {
property int padding: Style.spacing.popupPadding property int padding: Style.spacing.popupPadding
property int contentWidth: Style.space(280) property int contentWidth: Style.space(280)
property int contentHeight: Style.space(200) property int contentHeight: Style.space(200)
property var borderSpec: Border.surfaceSpec("popups", "border", Color.popups.border, Math.max(1, Style.space(2))) property var borderSpec: Border.surfaceSpec("popups", "border", Commons.Color.popups.border, Math.max(1, Style.space(2)))
property bool centerOnBar: false property bool centerOnBar: false
property bool open: false property bool open: false
property int gap: Style.gapsOut // distance between bar edge and panel property int gap: Style.gapsOut // distance between bar edge and panel
@@ -382,7 +383,7 @@ PanelWindow {
y: root.cardOrigin.y y: root.cardOrigin.y
width: root.contentWidth width: root.contentWidth
height: root.contentHeight height: root.contentHeight
color: Color.popups.background color: Commons.Color.popups.background
borderSpec: root.borderSpec borderSpec: root.borderSpec
padding: root.padding padding: root.padding
radius: Style.cornerRadius radius: Style.cornerRadius
+6 -5
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls as QQC
import QtQuick.Window import QtQuick.Window
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Searchable multi-select dropdown. Trigger shape matches Dropdown / // Searchable multi-select dropdown. Trigger shape matches Dropdown /
// SearchableDropdown; the popup shows a search field, an optional refresh // SearchableDropdown; the popup shows a search field, an optional refresh
@@ -33,11 +34,11 @@ Item {
property string triggerLabel: "" property string triggerLabel: ""
property bool showLabel: true property bool showLabel: true
property color foreground: Color.popups.text property color foreground: Commons.Color.popups.text
property color background: Color.popups.background property color background: Commons.Color.popups.background
property color popupBorder: Color.popups.border property color popupBorder: Commons.Color.popups.border
property color accent: Color.accent property color accent: Commons.Color.accent
readonly property var popupBorderSpec: Border.localOrSurfaceSpec("popups", "border", popupBorder, Color.popups.border, Style.normalBorderWidth) readonly property var popupBorderSpec: Border.localOrSurfaceSpec("popups", "border", popupBorder, Commons.Color.popups.border, Style.normalBorderWidth)
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property int rowHeight: Style.spacing.controlHeight property int rowHeight: Style.spacing.controlHeight
property int popupRowHeight: Style.spacing.popupRowHeight property int popupRowHeight: Style.spacing.popupRowHeight
+3 -2
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls as QQC import QtQuick.Controls as QQC
import qs.Commons import qs.Commons
import qs.Commons as Commons
Column { Column {
id: root id: root
@@ -10,8 +11,8 @@ Column {
property int from: 0 property int from: 0
property int to: 100 property int to: 100
property int stepSize: 1 property int stepSize: 1
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color accent: Color.accent property color accent: Commons.Color.accent
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property real fontSize: Style.font.body property real fontSize: Style.font.body
property real fieldWidth: Style.spacing.numberFieldWidth property real fieldWidth: Style.spacing.numberFieldWidth
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
Item { Item {
id: root id: root
@@ -7,7 +8,7 @@ Item {
property string text: "" property string text: ""
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property real fontSize: Style.font.body property real fontSize: Style.font.body
property color color: Color.foreground property color color: Commons.Color.foreground
property bool debugBounds: false property bool debugBounds: false
readonly property int renderedFontSize: Math.max(1, Math.round(fontSize)) readonly property int renderedFontSize: Math.max(1, Math.round(fontSize))
+2 -1
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Base item for plugin popup widgets. Many first-party plugins expose a bar // Base item for plugin popup widgets. Many first-party plugins expose a bar
// button plus a popup from one QML entry point; this base owns the shared // button plus a popup from one QML entry point; this base owns the shared
@@ -19,7 +20,7 @@ Item {
property bool popoutSwitchClosing: false property bool popoutSwitchClosing: false
readonly property bool opened: panelController.open readonly property bool opened: panelController.open
readonly property color barForeground: bar ? bar.barForeground : Color.foreground readonly property color barForeground: bar ? bar.barForeground : Commons.Color.foreground
function open() { panelController.show() } function open() { panelController.show() }
function close() { panelController.hide() } function close() { panelController.hide() }
+3 -2
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Small (22×22 by default) icon button used at the right edge of panel rows // Small (22×22 by default) icon button used at the right edge of panel rows
// for inline actions — forget network, confirm passphrase, unpair device, // for inline actions — forget network, confirm passphrase, unpair device,
@@ -29,7 +30,7 @@ BorderSurface {
property string iconText: "" property string iconText: ""
property string tooltipText: "" property string tooltipText: ""
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color hoverColor: foreground property color hoverColor: foreground
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property real fontSize: Style.font.icon property real fontSize: Style.font.icon
@@ -57,7 +58,7 @@ BorderSurface {
? Border.controlSpec("focus", hoverColor, hoverColor) ? Border.controlSpec("focus", hoverColor, hoverColor)
: (_hot && bordered : (_hot && bordered
? Border.controlSpec("hover-cursor", hoverColor, hoverColor) ? Border.controlSpec("hover-cursor", hoverColor, hoverColor)
: (bordered ? Border.controlSpec("normal", foreground, Color.accent) : Border.none())) : (bordered ? Border.controlSpec("normal", foreground, Commons.Color.accent) : Border.none()))
color: _showFocusRing color: _showFocusRing
? Style.focusFillFor(hoverColor, hoverColor) ? Style.focusFillFor(hoverColor, hoverColor)
+3 -2
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
Item { Item {
id: root id: root
@@ -8,7 +9,7 @@ Item {
property string title: "" property string title: ""
property string meta: "" property string meta: ""
property string detail: "" property string detail: ""
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property real iconSize: Style.font.display property real iconSize: Style.font.display
property real iconOpacity: 1.0 property real iconOpacity: 1.0
@@ -71,7 +72,7 @@ Item {
implicitHeight: detailText.implicitHeight + Style.space(4) implicitHeight: detailText.implicitHeight + Style.space(4)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: "transparent" color: "transparent"
borderSpec: Border.controlSpec("normal", root.foreground, Color.accent) borderSpec: Border.controlSpec("normal", root.foreground, Commons.Color.accent)
radius: Style.cornerRadius radius: Style.cornerRadius
Text { Text {
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Small-caps-style label that introduces a panel section ("DNS provider", // Small-caps-style label that introduces a panel section ("DNS provider",
// "Wi-Fi networks", "Output device", "Paired devices"). Sits between a // "Wi-Fi networks", "Output device", "Paired devices"). Sits between a
@@ -7,7 +8,7 @@ import qs.Commons
Text { Text {
id: root id: root
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property real fontSize: Style.font.caption property real fontSize: Style.font.caption
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
// 1px horizontal divider for panel sections. The alpha-on-foreground tint // 1px horizontal divider for panel sections. The alpha-on-foreground tint
// keeps the rule legible against the panel background without competing // keeps the rule legible against the panel background without competing
@@ -7,7 +8,7 @@ import qs.Commons
Rectangle { Rectangle {
id: root id: root
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property real strength: 0.12 property real strength: 0.12
width: parent ? parent.width : implicitWidth width: parent ? parent.width : implicitWidth
+5 -4
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
Item { Item {
id: root id: root
@@ -10,9 +11,9 @@ Item {
property real maximum: 1 property real maximum: 1
property real step: 0.05 property real step: 0.05
property bool integer: false property bool integer: false
property color trackColor: bar ? Style.selectedFillFor(bar.foreground, Color.accent) : "#333" property color trackColor: bar ? Style.selectedFillFor(bar.foreground, Commons.Color.accent) : "#333"
property color fillColor: bar ? bar.foreground : Color.foreground property color fillColor: bar ? bar.foreground : Commons.Color.foreground
property color knobColor: bar ? bar.foreground : Color.foreground property color knobColor: bar ? bar.foreground : Commons.Color.foreground
property bool dragging: false property bool dragging: false
property real trackHeight: Math.max(4, Math.round(Style.spacing.controlHeight * 0.11)) property real trackHeight: Math.max(4, Math.round(Style.spacing.controlHeight * 0.11))
property real knobSize: Math.max(14, Math.round(Style.spacing.controlHeight * 0.38)) property real knobSize: Math.max(14, Math.round(Style.spacing.controlHeight * 0.38))
@@ -23,7 +24,7 @@ Item {
// crossing the track shows). Purely visual — snapping is the caller's job via // crossing the track shows). Purely visual — snapping is the caller's job via
// `integer`/`step` or an index-based value. Default 0 leaves the track plain. // `integer`/`step` or an index-based value. Default 0 leaves the track plain.
property int tickCount: 0 property int tickCount: 0
property color tickColor: bar ? bar.background : Color.background property color tickColor: bar ? bar.background : Commons.Color.background
onValueChanged: if (!dragging) liveValue = value onValueChanged: if (!dragging) liveValue = value
+6 -5
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Styled wrapper around Qt Quick Controls ToolTip. Drop-in: declare inside // Styled wrapper around Qt Quick Controls ToolTip. Drop-in: declare inside
// the hovered item and bind `visible` to the hover state, e.g. // the hovered item and bind `visible` to the hover state, e.g.
@@ -9,7 +10,7 @@ import qs.Commons
// text: "Forget network" // text: "Forget network"
// } // }
// //
// Defaults pull from [tooltip] in shell.toml via Color.tooltip.*. Override // Defaults pull from [tooltip] in shell.toml via Commons.Color.tooltip.*. Override
// the panel* properties per-instance only when you need a tooltip that // the panel* properties per-instance only when you need a tooltip that
// intentionally diverges from the theme. // intentionally diverges from the theme.
// //
@@ -18,13 +19,13 @@ import qs.Commons
ToolTip { ToolTip {
id: root id: root
property color panelForeground: Color.tooltip.text property color panelForeground: Commons.Color.tooltip.text
property color panelBackground: Color.tooltip.background property color panelBackground: Commons.Color.tooltip.background
property color panelBorder: Color.tooltip.border property color panelBorder: Commons.Color.tooltip.border
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property real fontSize: Style.font.bodySmall property real fontSize: Style.font.bodySmall
readonly property var panelBorderSpec: Border.localOrSurfaceSpec("tooltip", "border", panelBorder, Color.tooltip.border, Style.normalBorderWidth) readonly property var panelBorderSpec: Border.localOrSurfaceSpec("tooltip", "border", panelBorder, Commons.Color.tooltip.border, Style.normalBorderWidth)
delay: 400 delay: 400
padding: 0 padding: 0
+4 -3
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Hyprland import Quickshell.Hyprland
import qs.Commons import qs.Commons
import qs.Commons as Commons
PopupWindow { PopupWindow {
id: root id: root
@@ -13,8 +14,8 @@ PopupWindow {
property int padding: Style.spacing.popupPadding property int padding: Style.spacing.popupPadding
property int contentWidth: Style.space(280) property int contentWidth: Style.space(280)
property int contentHeight: Style.space(200) property int contentHeight: Style.space(200)
property color borderColor: Color.popups.border property color borderColor: Commons.Color.popups.border
property var borderSpec: Border.localOrSurfaceSpec("popups", "border", borderColor, Color.popups.border, Math.max(1, Style.space(2))) property var borderSpec: Border.localOrSurfaceSpec("popups", "border", borderColor, Commons.Color.popups.border, Math.max(1, Style.space(2)))
property bool open: false property bool open: false
property bool centerOnBar: false property bool centerOnBar: false
// "click" — uses HyprlandFocusGrab so clicking outside dismisses the popup. // "click" — uses HyprlandFocusGrab so clicking outside dismisses the popup.
@@ -150,7 +151,7 @@ PopupWindow {
BorderSurface { BorderSurface {
id: card id: card
anchors.fill: parent anchors.fill: parent
color: Color.popups.background color: Commons.Color.popups.background
borderSpec: root.borderSpec borderSpec: root.borderSpec
padding: root.padding padding: root.padding
radius: Style.cornerRadius radius: Style.cornerRadius
+6 -5
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls as QQC import QtQuick.Controls as QQC
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Searchable single-select dropdown. Same trigger shape as Dropdown, but // Searchable single-select dropdown. Same trigger shape as Dropdown, but
// the popup leads with an embedded TextField that filters the option // the popup leads with an embedded TextField that filters the option
@@ -25,11 +26,11 @@ Item {
property string emptyText: "No matches" property string emptyText: "No matches"
property string triggerLabel: "" property string triggerLabel: ""
property color foreground: Color.popups.text property color foreground: Commons.Color.popups.text
property color background: Color.popups.background property color background: Commons.Color.popups.background
property color popupBorder: Color.popups.border property color popupBorder: Commons.Color.popups.border
property color accent: Color.accent property color accent: Commons.Color.accent
readonly property var popupBorderSpec: Border.localOrSurfaceSpec("popups", "border", popupBorder, Color.popups.border, Style.normalBorderWidth) readonly property var popupBorderSpec: Border.localOrSurfaceSpec("popups", "border", popupBorder, Commons.Color.popups.border, Style.normalBorderWidth)
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property int rowHeight: Style.spacing.controlHeight property int rowHeight: Style.spacing.controlHeight
property int popupRowHeight: Style.spacing.popupRowHeight property int popupRowHeight: Style.spacing.popupRowHeight
+5 -4
View File
@@ -4,6 +4,7 @@ import QtQuick.Shapes
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
// Centered speed test overlay shared by the network and disk speed tests. No // Centered speed test overlay shared by the network and disk speed tests. No
@@ -288,7 +289,7 @@ PanelWindow {
// round caps would leave a stray dot at the foot of the scale. // round caps would leave a stray dot at the foot of the scale.
ShapePath { ShapePath {
strokeWidth: dial.arcWidth * 3 strokeWidth: dial.arcWidth * 3
strokeColor: dial.arcVisible ? Qt.rgba(Color.accent.r, Color.accent.g, Color.accent.b, 0.18) : "transparent" strokeColor: dial.arcVisible ? Qt.rgba(Commons.Color.accent.r, Commons.Color.accent.g, Commons.Color.accent.b, 0.18) : "transparent"
fillColor: "transparent" fillColor: "transparent"
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
@@ -305,7 +306,7 @@ PanelWindow {
// Value: fills behind the needle. // Value: fills behind the needle.
ShapePath { ShapePath {
strokeWidth: dial.arcWidth strokeWidth: dial.arcWidth
strokeColor: dial.arcVisible ? Color.accent : "transparent" strokeColor: dial.arcVisible ? Commons.Color.accent : "transparent"
fillColor: "transparent" fillColor: "transparent"
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
@@ -356,8 +357,8 @@ PanelWindow {
radius: width / 2 radius: width / 2
gradient: Gradient { gradient: Gradient {
GradientStop { position: 0.0; color: Color.accent } GradientStop { position: 0.0; color: Commons.Color.accent }
GradientStop { position: 0.55; color: Color.accent } GradientStop { position: 0.55; color: Commons.Color.accent }
GradientStop { position: 1.0; color: "transparent" } GradientStop { position: 1.0; color: "transparent" }
} }
} }
+3 -2
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Single-line text input with the kit's focus + selection styling. Inherits // Single-line text input with the kit's focus + selection styling. Inherits
// from Qt Quick Controls TextField so the underlying type's API (text, // from Qt Quick Controls TextField so the underlying type's API (text,
@@ -18,8 +19,8 @@ import qs.Commons
TextField { TextField {
id: root id: root
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color accent: Color.accent property color accent: Commons.Color.accent
property color selectionTint: Style.selectionFillFor(foreground, accent) property color selectionTint: Style.selectionFillFor(foreground, accent)
property bool password: false property bool password: false
property real horizontalPadding: Style.spacing.controlPaddingX property real horizontalPadding: Style.spacing.controlPaddingX
+3 -2
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Labeled toggle row: title + optional description on the left, a // Labeled toggle row: title + optional description on the left, a
// `ToggleSwitch` on the right. Clicking anywhere on the row emits `clicked()`; // `ToggleSwitch` on the right. Clicking anywhere on the row emits `clicked()`;
@@ -28,8 +29,8 @@ BorderSurface {
// Override per-instance if a caller wants the opposite. // Override per-instance if a caller wants the opposite.
property bool rounded: Style.cornerRadius > 0 property bool rounded: Style.cornerRadius > 0
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color accent: Color.accent property color accent: Commons.Color.accent
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property real titleSize: Style.font.subtitle property real titleSize: Style.font.subtitle
property real descriptionSize: Style.font.caption property real descriptionSize: Style.font.caption
+3 -2
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Bare on/off switch: a track with a sliding knob and no label. This is the // Bare on/off switch: a track with a sliding knob and no label. This is the
// switch `Toggle` parks at the end of its labeled row, factored out so panel // switch `Toggle` parks at the end of its labeled row, factored out so panel
@@ -40,8 +41,8 @@ Item {
property bool cursorRing: interactive property bool cursorRing: interactive
property int cursorPad: Style.space(6) property int cursorPad: Style.space(6)
property bool rounded: Style.cornerRadius > 0 property bool rounded: Style.cornerRadius > 0
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color accent: Color.accent property color accent: Commons.Color.accent
signal toggled() signal toggled()
signal hovered(bool isHovered) signal hovered(bool isHovered)
+3 -2
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
Item { Item {
id: root id: root
@@ -8,8 +9,8 @@ Item {
property string text: "" property string text: ""
property string fontFamily: bar ? bar.fontFamily : Style.font.family property string fontFamily: bar ? bar.fontFamily : Style.font.family
property real fontSize: Style.font.body property real fontSize: Style.font.body
property color foreground: bar ? bar.barForeground : Color.foreground property color foreground: bar ? bar.barForeground : Commons.Color.foreground
property color activeColor: bar ? bar.urgent : Color.urgent property color activeColor: bar ? bar.urgent : Commons.Color.urgent
property bool active: false property bool active: false
property real horizontalMargin: 8.5 property real horizontalMargin: 8.5
property real verticalPadding: 6 property real verticalPadding: 6
+17 -16
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
Panel { Panel {
@@ -11,11 +12,11 @@ Panel {
ipcTarget: "omarchy.agents" ipcTarget: "omarchy.agents"
manageIpc: false manageIpc: false
readonly property color foreground: bar ? bar.foreground : Color.foreground readonly property color foreground: bar ? bar.foreground : Commons.Color.foreground
readonly property color urgent: bar ? bar.urgent : Color.urgent readonly property color urgent: bar ? bar.urgent : Commons.Color.urgent
readonly property color dim: Qt.darker(foreground, 1.55) readonly property color dim: Qt.darker(foreground, 1.55)
readonly property color surface: Color.popups.background readonly property color surface: Commons.Color.popups.background
readonly property color track: Style.selectedFillFor(foreground, Color.accent) readonly property color track: Style.selectedFillFor(foreground, Commons.Color.accent)
readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family
// Every subscription on one page, limits first: the question this panel // Every subscription on one page, limits first: the question this panel
@@ -719,7 +720,7 @@ Panel {
function iconCandidatesForProvider(p, surfaceColor) { function iconCandidatesForProvider(p, surfaceColor) {
if (!p) return [] if (!p) return []
var candidates = [] var candidates = []
if (colorLuminance(surfaceColor || Color.background) >= 0.5) if (colorLuminance(surfaceColor || Commons.Color.background) >= 0.5)
candidates.push(Qt.resolvedUrl("assets/" + p.providerId + "-light.svg")) candidates.push(Qt.resolvedUrl("assets/" + p.providerId + "-light.svg"))
candidates.push(Qt.resolvedUrl("assets/" + p.providerId + ".svg")) candidates.push(Qt.resolvedUrl("assets/" + p.providerId + ".svg"))
return candidates return candidates
@@ -1109,7 +1110,7 @@ Panel {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
textFormat: Text.PlainText textFormat: Text.PlainText
text: choice.modelData.providerName text: choice.modelData.providerName
color: choice.hasCursor ? Color.accent : root.foreground color: choice.hasCursor ? Commons.Color.accent : root.foreground
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.body font.pixelSize: Style.font.body
font.bold: true font.bold: true
@@ -1187,7 +1188,7 @@ Panel {
Text { Text {
textFormat: Text.PlainText textFormat: Text.PlainText
text: root.addCode text: root.addCode
color: Color.accent color: Commons.Color.accent
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.display font.pixelSize: Style.font.display
font.bold: true font.bold: true
@@ -1528,7 +1529,7 @@ Panel {
property bool hasCursor: false property bool hasCursor: false
implicitHeight: tileBody.implicitHeight + Style.space(20) implicitHeight: tileBody.implicitHeight + Style.space(20)
radius: Style.cornerRadius radius: Style.cornerRadius
color: hasCursor ? root.alpha(Color.accent, 0.14) : root.alpha(root.foreground, 0.05) color: hasCursor ? root.alpha(Commons.Color.accent, 0.14) : root.alpha(root.foreground, 0.05)
onHasCursorChanged: if (hasCursor) root.revealItem(tile) onHasCursorChanged: if (hasCursor) root.revealItem(tile)
Row { Row {
@@ -1540,7 +1541,7 @@ Panel {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
textFormat: Text.PlainText textFormat: Text.PlainText
text: tile.glyph text: tile.glyph
color: Color.accent color: Commons.Color.accent
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.heading font.pixelSize: Style.font.heading
} }
@@ -1549,7 +1550,7 @@ Panel {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
textFormat: Text.PlainText textFormat: Text.PlainText
text: tile.title text: tile.title
color: tile.hasCursor ? Color.accent : root.foreground color: tile.hasCursor ? Commons.Color.accent : root.foreground
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.body font.pixelSize: Style.font.body
font.bold: true font.bold: true
@@ -1583,16 +1584,16 @@ Panel {
implicitHeight: implicitWidth implicitHeight: implicitWidth
radius: Style.cornerRadius radius: Style.cornerRadius
// The cursor needs more than a shade deeper to read on a tinted square. // The cursor needs more than a shade deeper to read on a tinted square.
color: root.alpha(Color.accent, hasCursor ? 0.3 : 0.12) color: root.alpha(Commons.Color.accent, hasCursor ? 0.3 : 0.12)
border.width: hasCursor ? Math.max(1, Style.hoverBorderWidth) : 0 border.width: hasCursor ? Math.max(1, Style.hoverBorderWidth) : 0
border.color: Color.accent border.color: Commons.Color.accent
onHasCursorChanged: if (hasCursor) root.revealItem(heroButton) onHasCursorChanged: if (hasCursor) root.revealItem(heroButton)
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
textFormat: Text.PlainText textFormat: Text.PlainText
text: heroButton.glyph text: heroButton.glyph
color: Color.accent color: Commons.Color.accent
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.heading font.pixelSize: Style.font.heading
} }
@@ -1624,7 +1625,7 @@ Panel {
readonly property bool hot: linkMouse.containsMouse || picked readonly property bool hot: linkMouse.containsMouse || picked
onPickedChanged: if (picked) root.revealItem(link) onPickedChanged: if (picked) root.revealItem(link)
textFormat: Text.PlainText textFormat: Text.PlainText
color: current ? Color.accent : (hot ? root.foreground : idleColor) color: current ? Commons.Color.accent : (hot ? root.foreground : idleColor)
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.caption font.pixelSize: Style.font.caption
font.bold: current font.bold: current
@@ -1705,7 +1706,7 @@ Panel {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: Math.min(implicitWidth, parent.width * 0.6) width: Math.min(implicitWidth, parent.width * 0.6)
text: head.label text: head.label
color: head.picked ? Color.accent : root.foreground color: head.picked ? Commons.Color.accent : root.foreground
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.body font.pixelSize: Style.font.body
font.bold: head.isActive font.bold: head.isActive
@@ -1810,7 +1811,7 @@ Panel {
visible: head.isActive visible: head.isActive
anchors.right: parent.right anchors.right: parent.right
text: "ACTIVE" text: "ACTIVE"
color: Color.accent color: Commons.Color.accent
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.caption font.pixelSize: Style.font.caption
font.bold: true font.bold: true
+4 -3
View File
@@ -5,6 +5,7 @@ import QtQuick
import QtQuick.Effects import QtQuick.Effects
import QtQuick.Shapes import QtQuick.Shapes
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
Item { Item {
@@ -117,10 +118,10 @@ Item {
// pending; the latest theme payload should still apply. // pending; the latest theme payload should still apply.
if (pendingThemeVersion < 0) return if (pendingThemeVersion < 0) return
pendingThemeFallbackTimer.stop() pendingThemeFallbackTimer.stop()
Color.loadColors(pendingColorsRaw) Commons.Color.loadColors(pendingColorsRaw)
// Color.loadShell also refreshes Style so the type scale flips with the // Commons.Color.loadShell also refreshes Style so the type scale flips with the
// background reveal instead of waiting for a separate reload path. // background reveal instead of waiting for a separate reload path.
Color.loadShell(pendingShellRaw) Commons.Color.loadShell(pendingShellRaw)
Style.scheduleRefresh() Style.scheduleRefresh()
pendingThemeVersion = -1 pendingThemeVersion = -1
pendingColorsRaw = "" pendingColorsRaw = ""
+11 -10
View File
@@ -5,6 +5,7 @@ import Quickshell.Wayland
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "BarModel.js" as BarModel import "BarModel.js" as BarModel
@@ -71,14 +72,14 @@ Item {
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
// Bound to the central Color singleton so the bar tracks shell.toml's // Bound to the central Color singleton so the bar tracks shell.toml's
// [bar] section. Property names kept for the rest of this file's bindings. // [bar] section. Property names kept for the rest of this file's bindings.
property color themeForeground: Color.bar.text property color themeForeground: Commons.Color.bar.text
property color themeContrastForeground: Color.background property color themeContrastForeground: Commons.Color.background
property color transparentForeground: Color.bar.text property color transparentForeground: Commons.Color.bar.text
property color foreground: themeForeground property color foreground: themeForeground
property color barForeground: useTransparentForeground ? transparentForeground : themeForeground property color barForeground: useTransparentForeground ? transparentForeground : themeForeground
property bool foregroundAnimationEnabled: true property bool foregroundAnimationEnabled: true
property color background: Color.bar.background property color background: Commons.Color.bar.background
property color urgent: Color.bar.active property color urgent: Commons.Color.bar.active
Behavior on barForeground { enabled: root.foregroundAnimationEnabled; ColorAnimation { duration: Style.duration(420); easing.type: Easing.OutCubic } } Behavior on barForeground { enabled: root.foregroundAnimationEnabled; ColorAnimation { duration: Style.duration(420); easing.type: Easing.OutCubic } }
Behavior on background { ColorAnimation { duration: Style.duration(420); easing.type: Easing.OutCubic } } Behavior on background { ColorAnimation { duration: Style.duration(420); easing.type: Easing.OutCubic } }
@@ -1342,8 +1343,8 @@ Item {
id: tooltipBubble id: tooltipBubble
implicitWidth: tooltipLabel.implicitWidth + 20 implicitWidth: tooltipLabel.implicitWidth + 20
implicitHeight: tooltipLabel.implicitHeight + 14 implicitHeight: tooltipLabel.implicitHeight + 14
color: Color.tooltip.background color: Commons.Color.tooltip.background
borderSpec: Border.surfaceSpec("tooltip", "border", Color.tooltip.border, 1) borderSpec: Border.surfaceSpec("tooltip", "border", Commons.Color.tooltip.border, 1)
radius: Style.cornerRadius radius: Style.cornerRadius
Text { Text {
@@ -1351,7 +1352,7 @@ Item {
textFormat: Text.PlainText textFormat: Text.PlainText
anchors.centerIn: parent anchors.centerIn: parent
text: root.tooltipText text: root.tooltipText
color: Color.tooltip.text color: Commons.Color.tooltip.text
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.body font.pixelSize: Style.font.body
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
@@ -1470,7 +1471,7 @@ Item {
y: targetRect ? Math.round(targetRect.y) : 0 y: targetRect ? Math.round(targetRect.y) : 0
width: targetRect ? targetRect.width : 0 width: targetRect ? targetRect.width : 0
height: targetRect ? targetRect.height : 0 height: targetRect ? targetRect.height : 0
color: Color.accent color: Commons.Color.accent
radius: Math.min(width, height) / 2 radius: Math.min(width, height) / 2
} }
} }
@@ -1905,7 +1906,7 @@ Item {
visible: opacity > 0 visible: opacity > 0
opacity: slot.panelOpen && !slot.dragSource ? 0.9 : 0 opacity: slot.panelOpen && !slot.dragSource ? 0.9 : 0
color: Color.accent color: Commons.Color.accent
radius: Math.min(width, height) / 2 radius: Math.min(width, height) / 2
width: root.vertical ? Style.space(2) : slot.panelIndicatorExtent width: root.vertical ? Style.space(2) : slot.panelIndicatorExtent
height: root.vertical ? slot.panelIndicatorExtent : Style.space(2) height: root.vertical ? slot.panelIndicatorExtent : Style.space(2)
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
BarIndicator { BarIndicator {
@@ -15,7 +16,7 @@ BarIndicator {
activeTooltipText: "Disable Passwordless Sudo" activeTooltipText: "Disable Passwordless Sudo"
inactiveTooltipText: "Passwordless Sudo" inactiveTooltipText: "Passwordless Sudo"
useActiveColor: true useActiveColor: true
activeColor: Color.urgent activeColor: Commons.Color.urgent
function refresh() { function refresh() {
if (!root.bar) return if (!root.bar) return
+2 -1
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
BarWidget { BarWidget {
@@ -34,7 +35,7 @@ BarWidget {
anchors.left: parent.left anchors.left: parent.left
width: parent.width width: parent.width
text: root.title text: root.title
color: root.bar ? root.bar.barForeground : Color.foreground color: root.bar ? root.bar.barForeground : Commons.Color.foreground
font.family: root.bar ? root.bar.fontFamily : Style.font.family font.family: root.bar ? root.bar.fontFamily : Style.font.family
font.pixelSize: Style.font.body font.pixelSize: Style.font.body
elide: Text.ElideRight elide: Text.ElideRight
+4 -3
View File
@@ -4,6 +4,7 @@ import QtQuick.Controls
import QtQuick.Effects import QtQuick.Effects
import Quickshell.Services.SystemTray import Quickshell.Services.SystemTray
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "TrayModel.js" as TrayModel import "TrayModel.js" as TrayModel
@@ -16,7 +17,7 @@ BarWidget {
property bool trayMenuOpen: false property bool trayMenuOpen: false
property var activeTrayItem: null property var activeTrayItem: null
property var activeTrayAnchor: null property var activeTrayAnchor: null
readonly property color foreground: bar ? bar.foreground : Color.foreground readonly property color foreground: bar ? bar.foreground : Commons.Color.foreground
readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family
readonly property var pinnedIds: settings.pinned instanceof Array ? settings.pinned : [] readonly property var pinnedIds: settings.pinned instanceof Array ? settings.pinned : []
readonly property var hiddenIds: settings.hidden instanceof Array ? settings.hidden : [] readonly property var hiddenIds: settings.hidden instanceof Array ? settings.hidden : []
@@ -617,7 +618,7 @@ BarWidget {
anchors.rightMargin: Style.space(10) anchors.rightMargin: Style.space(10)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
height: 1 height: 1
color: Color.popups.border color: Commons.Color.popups.border
opacity: 0.45 opacity: 0.45
} }
} }
@@ -671,7 +672,7 @@ BarWidget {
anchors.rightMargin: Style.space(10) anchors.rightMargin: Style.space(10)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
height: 1 height: 1
color: Color.popups.border color: Commons.Color.popups.border
opacity: 0.45 opacity: 0.45
} }
+7 -6
View File
@@ -3,6 +3,7 @@ import Quickshell.Io
import Quickshell.Wayland import Quickshell.Wayland
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "ClipboardHistory.js" as ClipboardHistory import "ClipboardHistory.js" as ClipboardHistory
@@ -22,13 +23,13 @@ Item {
// Shares the [menu] surface tokens — themes that style the menu also // Shares the [menu] surface tokens — themes that style the menu also
// style the clipboard. Selected-row colors composed in the // style the clipboard. Selected-row colors composed in the
// singleton so consumers drop them straight into Rectangle bindings. // singleton so consumers drop them straight into Rectangle bindings.
property color background: Color.menu.background property color background: Commons.Color.menu.background
property color foreground: Color.menu.text property color foreground: Commons.Color.menu.text
property color border: Color.menu.border property color border: Commons.Color.menu.border
property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2))) property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2)))
property color scrim: Color.menu.scrim property color scrim: Commons.Color.menu.scrim
property color selectedBackground: Color.menu.selectedBackground property color selectedBackground: Commons.Color.menu.selectedBackground
property color selectedText: Color.menu.selectedText property color selectedText: Commons.Color.menu.selectedText
readonly property int cornerRadius: Style.cornerRadius readonly property int cornerRadius: Style.cornerRadius
property string fontFamily: Style.font.menuFamily property string fontFamily: Style.font.menuFamily
property int contentMargin: Style.spacing.panelPadding property int contentMargin: Style.spacing.panelPadding
+5 -4
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls
import Quickshell import Quickshell
import qs.Ui import qs.Ui
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Visual reference + live playground for omarchy-shell's common UI // Visual reference + live playground for omarchy-shell's common UI
// components. Summon with `omarchy dev ui-preview`, or directly via: // components. Summon with `omarchy dev ui-preview`, or directly via:
@@ -66,10 +67,10 @@ Item {
property var shell: null property var shell: null
// ---- theme -------------------------------------------------------------- // ---- theme --------------------------------------------------------------
readonly property color foreground: Color.foreground readonly property color foreground: Commons.Color.foreground
readonly property color background: Color.background readonly property color background: Commons.Color.background
readonly property color accent: Color.accent readonly property color accent: Commons.Color.accent
readonly property color urgent: Color.urgent readonly property color urgent: Commons.Color.urgent
readonly property string fontFamily: "monospace" readonly property string fontFamily: "monospace"
// Fake `bar` for components that take a whole bar object (e.g. Slider). // Fake `bar` for components that take a whole bar object (e.g. Slider).
+7 -6
View File
@@ -3,6 +3,7 @@ import Quickshell.Io
import Quickshell.Wayland import Quickshell.Wayland
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "EmojiSearch.js" as EmojiSearch import "EmojiSearch.js" as EmojiSearch
@@ -23,13 +24,13 @@ Item {
// Shares the [menu] surface tokens — themes that style the menu also // Shares the [menu] surface tokens — themes that style the menu also
// style emojis. Selected-cell colors composed in the // style emojis. Selected-cell colors composed in the
// singleton so consumers drop them straight into Rectangle bindings. // singleton so consumers drop them straight into Rectangle bindings.
property color background: Color.menu.background property color background: Commons.Color.menu.background
property color foreground: Color.menu.text property color foreground: Commons.Color.menu.text
property color border: Color.menu.border property color border: Commons.Color.menu.border
property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2))) property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2)))
property color scrim: Color.menu.scrim property color scrim: Commons.Color.menu.scrim
property color selectedBackground: Color.menu.selectedBackground property color selectedBackground: Commons.Color.menu.selectedBackground
property color selectedText: Color.menu.selectedText property color selectedText: Commons.Color.menu.selectedText
readonly property int cornerRadius: Style.cornerRadius readonly property int cornerRadius: Style.cornerRadius
property string fontFamily: Style.font.menuFamily property string fontFamily: Style.font.menuFamily
property int contentMargin: Style.spacing.panelPadding property int contentMargin: Style.spacing.panelPadding
+7 -6
View File
@@ -5,6 +5,7 @@ import QtQuick
import QtQuick.Effects import QtQuick.Effects
import QtQuick.Shapes import QtQuick.Shapes
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "ImagePickerModel.js" as ImagePickerModel import "ImagePickerModel.js" as ImagePickerModel
@@ -37,14 +38,14 @@ Item {
property string themeRows: "" property string themeRows: ""
property bool themeMode: false property bool themeMode: false
property bool themeOpenPending: false property bool themeOpenPending: false
// Bound to the central [image-picker] section in shell.toml via Color.qml. // Bound to the central [image-picker] section in shell.toml via Commons.Color.qml.
// `dimColor` tints unselected slices and text outlines on top of the scrim; // `dimColor` tints unselected slices and text outlines on top of the scrim;
// it intentionally tracks the foundational background, not a surface role. // it intentionally tracks the foundational background, not a surface role.
property color dimColor: Color.background property color dimColor: Commons.Color.background
property color foreground: Color.imagePicker.text property color foreground: Commons.Color.imagePicker.text
property color scrim: Color.imagePicker.scrim property color scrim: Commons.Color.imagePicker.scrim
property color selectedBorder: Color.imagePicker.selectedBorder property color selectedBorder: Commons.Color.imagePicker.selectedBorder
property color unselectedBorder: Color.imagePicker.unselectedBorder property color unselectedBorder: Commons.Color.imagePicker.unselectedBorder
property int expandedWidth: 768 property int expandedWidth: 768
property int expandedHeight: 475 property int expandedHeight: 475
property int sliceWidth: 108 property int sliceWidth: 108
+12 -11
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Effects import QtQuick.Effects
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
Item { Item {
@@ -42,8 +43,8 @@ Item {
readonly property bool showPasswordCursor: inputEnabled && !authenticatingPassword && failureMessage.length === 0 readonly property bool showPasswordCursor: inputEnabled && !authenticatingPassword && failureMessage.length === 0
readonly property bool errorState: failureMessage.length > 0 readonly property bool errorState: failureMessage.length > 0
readonly property var inputBorderSpec: errorState readonly property var inputBorderSpec: errorState
? Border.surfaceSpec("lock", "border-error", Color.lock.borderError, root.outlineThickness, "border-alpha") ? Border.surfaceSpec("lock", "border-error", Commons.Color.lock.borderError, root.outlineThickness, "border-alpha")
: Border.surfaceSpec("lock", "border-active", Color.lock.borderActive, root.outlineThickness, "border-alpha") : Border.surfaceSpec("lock", "border-active", Commons.Color.lock.borderActive, root.outlineThickness, "border-alpha")
readonly property bool video: Util.isVideoPath(root.backgroundPath) readonly property bool video: Util.isVideoPath(root.backgroundPath)
readonly property bool feedActive: root.video && root.loadBackground && !root.displaysBlank && !root.powerSaverActive readonly property bool feedActive: root.video && root.loadBackground && !root.displaysBlank && !root.powerSaverActive
@@ -97,7 +98,7 @@ Item {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: Color.background color: Commons.Color.background
BackgroundMedia { BackgroundMedia {
id: wallpaper id: wallpaper
@@ -156,7 +157,7 @@ Item {
width: root.fieldWidth width: root.fieldWidth
height: root.fieldHeight height: root.fieldHeight
anchors.centerIn: parent anchors.centerIn: parent
color: Color.lock.background color: Commons.Color.lock.background
borderSpec: root.inputBorderSpec borderSpec: root.inputBorderSpec
radius: Style.cornerRadius radius: Style.cornerRadius
clip: true clip: true
@@ -179,16 +180,16 @@ Item {
echoMode: TextInput.Password echoMode: TextInput.Password
passwordCharacter: "\u25CF" passwordCharacter: "\u25CF"
passwordMaskDelay: 0 passwordMaskDelay: 0
color: Color.lock.text color: Commons.Color.lock.text
selectionColor: Color.lock.selection selectionColor: Commons.Color.lock.selection
selectedTextColor: Color.lock.text selectedTextColor: Commons.Color.lock.text
font.family: Style.font.family font.family: Style.font.family
font.pixelSize: text.length > 0 ? Math.max(1, Math.floor(root.passwordDotFontSize * root.passwordDotScale)) : root.fieldFontSize font.pixelSize: text.length > 0 ? Math.max(1, Math.floor(root.passwordDotFontSize * root.passwordDotScale)) : root.fieldFontSize
font.letterSpacing: text.length > 0 ? root.passwordDotLetterSpacing * root.passwordDotScale : 0 font.letterSpacing: text.length > 0 ? root.passwordDotLetterSpacing * root.passwordDotScale : 0
cursorVisible: activeFocus && root.showPasswordCursor && text.length > 0 cursorVisible: activeFocus && root.showPasswordCursor && text.length > 0
cursorDelegate: Rectangle { cursorDelegate: Rectangle {
width: 2 width: 2
color: Color.lock.text color: Commons.Color.lock.text
visible: passwordInput.cursorVisible visible: passwordInput.cursorVisible
} }
@@ -224,7 +225,7 @@ Item {
anchors.fill: passwordInput anchors.fill: passwordInput
text: root.authenticatingPassword ? "Checking…" : (root.failureMessage.length > 0 ? root.failureMessage : root.placeholderText) text: root.authenticatingPassword ? "Checking…" : (root.failureMessage.length > 0 ? root.failureMessage : root.placeholderText)
visible: passwordInput.text.length === 0 visible: passwordInput.text.length === 0
color: root.authenticatingPassword ? Color.lock.text : (root.failureMessage.length > 0 ? Color.lock.textError : Color.lock.placeholder) color: root.authenticatingPassword ? Commons.Color.lock.text : (root.failureMessage.length > 0 ? Commons.Color.lock.textError : Commons.Color.lock.placeholder)
font.family: Style.font.family font.family: Style.font.family
font.pixelSize: root.fieldFontSize font.pixelSize: root.fieldFontSize
font.italic: !root.authenticatingPassword && root.failureMessage.length > 0 font.italic: !root.authenticatingPassword && root.failureMessage.length > 0
@@ -247,7 +248,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: root.fingerprintConfigured visible: root.fingerprintConfigured
text: root.fingerprintUnavailable ? "󰺱" : "󰈷" text: root.fingerprintUnavailable ? "󰺱" : "󰈷"
color: root.fingerprintUnavailable ? Color.lock.textError : Color.lock.placeholder color: root.fingerprintUnavailable ? Commons.Color.lock.textError : Commons.Color.lock.placeholder
font.family: Style.font.family font.family: Style.font.family
font.pixelSize: Math.round(root.fieldFontSize * 1.1) font.pixelSize: Math.round(root.fieldFontSize * 1.1)
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
@@ -266,7 +267,7 @@ Item {
anchors.horizontalCenter: inputField.horizontalCenter anchors.horizontalCenter: inputField.horizontalCenter
visible: root.fingerprintConfigured && root.fingerprintUnavailable visible: root.fingerprintConfigured && root.fingerprintUnavailable
text: "Fingerprint reader unavailable" text: "Fingerprint reader unavailable"
color: Color.lock.textError color: Commons.Color.lock.textError
font.family: Style.font.family font.family: Style.font.family
font.pixelSize: Style.font.heading font.pixelSize: Style.font.heading
font.italic: true font.italic: true
+2 -1
View File
@@ -4,6 +4,7 @@ import Quickshell.Io
import Quickshell.Services.Pam import Quickshell.Services.Pam
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "FingerprintModel.js" as FingerprintModel import "FingerprintModel.js" as FingerprintModel
Item { Item {
@@ -467,7 +468,7 @@ Item {
WlSessionLockSurface { WlSessionLockSurface {
id: lockSurface id: lockSurface
color: Color.background color: Commons.Color.background
LockView { LockView {
id: lockView id: lockView
+9 -8
View File
@@ -3,6 +3,7 @@ import Quickshell.Io
import Quickshell.Wayland import Quickshell.Wayland
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "MenuModel.js" as MenuModel import "MenuModel.js" as MenuModel
@@ -81,17 +82,17 @@ Item {
property bool deleteConfirmOpen: false property bool deleteConfirmOpen: false
property var deleteTarget: null property var deleteTarget: null
onOpenedChanged: if (!opened) { deleteConfirmOpen = false; deleteTarget = null } onOpenedChanged: if (!opened) { deleteConfirmOpen = false; deleteTarget = null }
// Bound to the central [menu] section in shell.toml via Color.qml. // Bound to the central [menu] section in shell.toml via Commons.Color.qml.
// Each color already includes its alpha companion (composed in the // Each color already includes its alpha companion (composed in the
// singleton), so consumers can drop them straight into a Rectangle. // singleton), so consumers can drop them straight into a Rectangle.
property color background: Color.menu.background property color background: Commons.Color.menu.background
property color foreground: Color.menu.text property color foreground: Commons.Color.menu.text
property color border: Color.menu.border property color border: Commons.Color.menu.border
property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2))) property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2)))
property color scrim: Color.menu.scrim property color scrim: Commons.Color.menu.scrim
property color selectedBackground: Color.menu.selectedBackground property color selectedBackground: Commons.Color.menu.selectedBackground
property color selectedText: Color.menu.selectedText property color selectedText: Commons.Color.menu.selectedText
property color selectedBorder: Color.menu.selectedBorder property color selectedBorder: Commons.Color.menu.selectedBorder
property var selectedBorderSpec: Border.surfaceSpec("menu", "selected-border", selectedBorder, 0) property var selectedBorderSpec: Border.surfaceSpec("menu", "selected-border", selectedBorder, 0)
readonly property real rowReservedBorderLeft: Border.left(selectedBorderSpec) readonly property real rowReservedBorderLeft: Border.left(selectedBorderSpec)
readonly property real rowReservedBorderRight: Border.right(selectedBorderSpec) readonly property real rowReservedBorderRight: Border.right(selectedBorderSpec)
@@ -6,6 +6,7 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "../NotificationLogic.js" as NotificationLogic import "../NotificationLogic.js" as NotificationLogic
@@ -46,10 +47,10 @@ BorderSurface {
readonly property string sanitizedBody: sanitizeBody(body) readonly property string sanitizedBody: sanitizeBody(body)
readonly property string styledBody: NotificationLogic.styledBody(body, app, appIcon) readonly property string styledBody: NotificationLogic.styledBody(body, app, appIcon)
readonly property color dimColor: Qt.darker(Color.notifications.text, 1.4) readonly property color dimColor: Qt.darker(Commons.Color.notifications.text, 1.4)
readonly property color bodyColor: Qt.darker(Color.notifications.text, 1.15) readonly property color bodyColor: Qt.darker(Commons.Color.notifications.text, 1.15)
readonly property color accentColor: urgency === 2 ? Color.urgent : (urgency === 0 ? dimColor : Color.notifications.countdown) readonly property color accentColor: urgency === 2 ? Commons.Color.urgent : (urgency === 0 ? dimColor : Commons.Color.notifications.countdown)
readonly property var cardBorderSpec: Border.surfaceSpec("notifications", "border", Color.notifications.border, Math.max(1, Style.space(2))) readonly property var cardBorderSpec: Border.surfaceSpec("notifications", "border", Commons.Color.notifications.border, Math.max(1, Style.space(2)))
function sanitizeBody(s) { function sanitizeBody(s) {
return NotificationLogic.sanitizeBody(s, app, appIcon) return NotificationLogic.sanitizeBody(s, app, appIcon)
@@ -68,7 +69,7 @@ BorderSurface {
// doesn't push content under the bottom edge. // doesn't push content under the bottom edge.
implicitHeight: mainColumn.implicitHeight + borderTop + borderBottom implicitHeight: mainColumn.implicitHeight + borderTop + borderBottom
radius: cornerRadius radius: cornerRadius
color: Color.notifications.background color: Commons.Color.notifications.background
borderSpec: cardBorderSpec borderSpec: cardBorderSpec
clip: true clip: true
@@ -137,7 +138,7 @@ BorderSurface {
anchors.centerIn: parent anchors.centerIn: parent
visible: root.hasGlyph && smallIconImage.status !== Image.Ready visible: root.hasGlyph && smallIconImage.status !== Image.Ready
text: root.glyph text: root.glyph
color: Color.notifications.text color: Commons.Color.notifications.text
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.displayLarge font.pixelSize: Style.font.displayLarge
} }
@@ -148,7 +149,7 @@ BorderSurface {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
visible: root.compactGlyph visible: root.compactGlyph
text: root.glyph text: root.glyph
color: Color.notifications.text color: Commons.Color.notifications.text
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.icon font.pixelSize: Style.font.icon
} }
@@ -170,7 +171,7 @@ BorderSurface {
visible: root.summary.length > 0 visible: root.summary.length > 0
text: root.summary text: root.summary
font.family: "Liberation Sans" font.family: "Liberation Sans"
color: Color.notifications.text color: Commons.Color.notifications.text
font.pixelSize: Style.font.title font.pixelSize: Style.font.title
font.bold: true font.bold: true
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
@@ -212,7 +213,7 @@ BorderSurface {
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: "✕" text: "✕"
color: closeArea.containsMouse ? Color.notifications.text : root.dimColor color: closeArea.containsMouse ? Commons.Color.notifications.text : root.dimColor
font.pixelSize: Math.round(Style.font.caption * 1.44) font.pixelSize: Math.round(Style.font.caption * 1.44)
} }
+7 -6
View File
@@ -3,6 +3,7 @@ import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "OsdModel.js" as OsdModel import "OsdModel.js" as OsdModel
@@ -139,8 +140,8 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin: Style.space(67) anchors.bottomMargin: Style.space(67)
color: Util.alpha(Color.background, 0.97) color: Util.alpha(Commons.Color.background, 0.97)
borderSpec: Border.surfaceSpec("popups", "border", Color.popups.border, Math.max(1, Style.space(2))) borderSpec: Border.surfaceSpec("popups", "border", Commons.Color.popups.border, Math.max(1, Style.space(2)))
radius: Style.cornerRadius radius: Style.cornerRadius
opacity: root.opened ? 1 : 0 opacity: root.opened ? 1 : 0
@@ -162,7 +163,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: root.icon text: root.icon
font: iconMetrics.font font: iconMetrics.font
color: Color.popups.text color: Commons.Color.popups.text
} }
} }
Rectangle { Rectangle {
@@ -170,11 +171,11 @@ Item {
width: root.barWidth width: root.barWidth
height: Math.max(Style.space(6), Style.spacing.sm) height: Math.max(Style.space(6), Style.spacing.sm)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: Util.alpha(Color.popups.text, 0.45) color: Util.alpha(Commons.Color.popups.text, 0.45)
Rectangle { Rectangle {
height: parent.height height: parent.height
width: parent.width * (root.hasProgress ? root.value / root.maxValue : 0) width: parent.width * (root.hasProgress ? root.value / root.maxValue : 0)
color: Color.accent color: Commons.Color.accent
Behavior on width { Behavior on width {
enabled: root.opened enabled: root.opened
@@ -192,7 +193,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: root.message text: root.message
font: messageMetrics.font font: messageMetrics.font
color: Color.popups.text color: Commons.Color.popups.text
elide: Text.ElideRight elide: Text.ElideRight
maximumLineCount: 1 maximumLineCount: 1
} }
+3 -2
View File
@@ -6,6 +6,7 @@ import Quickshell.Services.Mpris
import Quickshell.Services.Pipewire import Quickshell.Services.Pipewire
import qs.Ui import qs.Ui
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "Model.js" as Model import "Model.js" as Model
Panel { Panel {
@@ -179,10 +180,10 @@ Panel {
readonly property string toggleHint: anyAudible ? "Mute" : "Unmute" readonly property string toggleHint: anyAudible ? "Mute" : "Unmute"
readonly property color hoverFill: bar readonly property color hoverFill: bar
? Style.hoverFillFor(bar.foreground, Color.accent) ? Style.hoverFillFor(bar.foreground, Commons.Color.accent)
: "transparent" : "transparent"
readonly property color selectedFill: bar readonly property color selectedFill: bar
? Style.selectedFillFor(bar.foreground, Color.accent) ? Style.selectedFillFor(bar.foreground, Commons.Color.accent)
: "transparent" : "transparent"
function sectionCount(section) { function sectionCount(section) {
+3 -2
View File
@@ -6,6 +6,7 @@ import Quickshell.Bluetooth
import Quickshell.Services.Pipewire import Quickshell.Services.Pipewire
import qs.Ui import qs.Ui
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "Model.js" as Model import "Model.js" as Model
Panel { Panel {
@@ -104,10 +105,10 @@ Panel {
readonly property string toggleHint: root.adapter && root.adapter.enabled ? "Turn Bluetooth off" : "Turn Bluetooth on" readonly property string toggleHint: root.adapter && root.adapter.enabled ? "Turn Bluetooth off" : "Turn Bluetooth on"
readonly property color hoverFill: bar readonly property color hoverFill: bar
? Style.hoverFillFor(bar.foreground, Color.accent) ? Style.hoverFillFor(bar.foreground, Commons.Color.accent)
: "transparent" : "transparent"
readonly property color selectedFill: bar readonly property color selectedFill: bar
? Style.selectedFillFor(bar.foreground, Color.accent) ? Style.selectedFillFor(bar.foreground, Commons.Color.accent)
: "transparent" : "transparent"
function sectionCount(section) { function sectionCount(section) {
+9 -8
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "Model.js" as Model import "Model.js" as Model
@@ -75,7 +76,7 @@ Panel {
// Guarded so the widget renders before the bar is injected (the bar-widget // Guarded so the widget renders before the bar is injected (the bar-widget
// contract instantiates it bare). // contract instantiates it bare).
readonly property color contentForeground: bar ? bar.foreground : Color.foreground readonly property color contentForeground: bar ? bar.foreground : Commons.Color.foreground
readonly property string contentFontFamily: bar ? bar.fontFamily : Style.font.family readonly property string contentFontFamily: bar ? bar.fontFamily : Style.font.family
readonly property int cellWidth: Style.space(52) readonly property int cellWidth: Style.space(52)
@@ -302,7 +303,7 @@ Panel {
anchors.baseline: heroDate.baseline anchors.baseline: heroDate.baseline
text: "󰃭" text: "󰃭"
color: heroMouse.containsMouse color: heroMouse.containsMouse
? Style.hoverStateColor(root.contentForeground, Color.accent) ? Style.hoverStateColor(root.contentForeground, Commons.Color.accent)
: root.contentForeground : root.contentForeground
font.family: root.contentFontFamily font.family: root.contentFontFamily
// Decorative, and deliberately outside the Style.font.* // Decorative, and deliberately outside the Style.font.*
@@ -317,7 +318,7 @@ Panel {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: Qt.formatDate(root.today, "MMMM d") text: Qt.formatDate(root.today, "MMMM d")
color: heroMouse.containsMouse color: heroMouse.containsMouse
? Style.hoverStateColor(root.contentForeground, Color.accent) ? Style.hoverStateColor(root.contentForeground, Commons.Color.accent)
: root.contentForeground : root.contentForeground
font.family: root.contentFontFamily font.family: root.contentFontFamily
font.pixelSize: 52 font.pixelSize: 52
@@ -455,7 +456,7 @@ Panel {
width: Math.round(parent.width * root.yearDone) width: Math.round(parent.width * root.yearDone)
height: parent.height height: parent.height
radius: parent.radius radius: parent.radius
color: Style.selectedStateColor(root.contentForeground, Color.accent) color: Style.selectedStateColor(root.contentForeground, Commons.Color.accent)
Behavior on width { NumberAnimation { duration: Style.duration(160); easing.type: Easing.OutCubic } } Behavior on width { NumberAnimation { duration: Style.duration(160); easing.type: Easing.OutCubic } }
} }
@@ -513,7 +514,7 @@ Panel {
width: Math.round(parent.width * root.lifeDone) width: Math.round(parent.width * root.lifeDone)
height: parent.height height: parent.height
radius: parent.radius radius: parent.radius
color: Style.selectedStateColor(root.contentForeground, Color.accent) color: Style.selectedStateColor(root.contentForeground, Commons.Color.accent)
Behavior on width { NumberAnimation { duration: Style.duration(160); easing.type: Easing.OutCubic } } Behavior on width { NumberAnimation { duration: Style.duration(160); easing.type: Easing.OutCubic } }
} }
@@ -575,14 +576,14 @@ Panel {
height: Style.space(16) height: Style.space(16)
radius: Style.cornerRadius radius: Style.cornerRadius
color: weekStartMouse.containsMouse color: weekStartMouse.containsMouse
? Style.hoverFillFor(root.contentForeground, Color.accent) ? Style.hoverFillFor(root.contentForeground, Commons.Color.accent)
: "transparent" : "transparent"
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: "W" text: "W"
color: weekStartMouse.containsMouse color: weekStartMouse.containsMouse
? Style.hoverStateColor(root.contentForeground, Color.accent) ? Style.hoverStateColor(root.contentForeground, Commons.Color.accent)
: Qt.darker(root.contentForeground, 1.9) : Qt.darker(root.contentForeground, 1.9)
font.family: root.contentFontFamily font.family: root.contentFontFamily
font.pixelSize: Style.font.caption font.pixelSize: Style.font.caption
@@ -667,7 +668,7 @@ Panel {
// over a grid this quiet. // over a grid this quiet.
color: "transparent" color: "transparent"
border.width: modelData.today ? Style.spacing.hairline : 0 border.width: modelData.today ? Style.spacing.hairline : 0
border.color: Style.normalBorderFor(root.contentForeground, Color.accent) border.color: Style.normalBorderFor(root.contentForeground, Commons.Color.accent)
Text { Text {
textFormat: Text.PlainText textFormat: Text.PlainText
+2 -1
View File
@@ -1,12 +1,13 @@
import QtQuick import QtQuick
import QtQuick.Shapes import QtQuick.Shapes
import qs.Commons import qs.Commons
import qs.Commons as Commons
Item { Item {
id: root id: root
property real iconSize: Style.font.icon property real iconSize: Style.font.icon
property color color: Color.foreground property color color: Commons.Color.foreground
width: iconSize * 1.18 width: iconSize * 1.18
height: iconSize height: iconSize
+3 -2
View File
@@ -4,6 +4,7 @@ import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "Model.js" as Model import "Model.js" as Model
@@ -32,8 +33,8 @@ Panel {
"Cataloging chaos" "Cataloging chaos"
] ]
readonly property string heroPhraseText: activePhrases[phraseIndex % activePhrases.length] readonly property string heroPhraseText: activePhrases[phraseIndex % activePhrases.length]
readonly property color foreground: bar ? bar.foreground : Color.foreground readonly property color foreground: bar ? bar.foreground : Commons.Color.foreground
readonly property color urgent: bar ? bar.urgent : Color.urgent readonly property color urgent: bar ? bar.urgent : Commons.Color.urgent
readonly property color dim: Qt.darker(foreground, 1.55) readonly property color dim: Qt.darker(foreground, 1.55)
readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family
readonly property color iconColor: dropbox.authenticated && dropbox.active ? foreground : dim readonly property color iconColor: dropbox.authenticated && dropbox.active ? foreground : dim
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "Arc.js" as Arc import "Arc.js" as Arc
// One line of text arched over what sits below it, each character turned to // One line of text arched over what sits below it, each character turned to
@@ -13,7 +14,7 @@ Item {
property real rise: 6 property real rise: 6
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property int pixelSize: Style.font.caption property int pixelSize: Style.font.caption
property color color: Color.foreground property color color: Commons.Color.foreground
FontMetrics { FontMetrics {
id: metrics id: metrics
+4 -3
View File
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "Model.js" as Model import "Model.js" as Model
import "Greetings.js" as Greet import "Greetings.js" as Greet
@@ -52,7 +53,7 @@ Rectangle {
// arrow keys never reads darker than the daytime rows around it. // arrow keys never reads darker than the daytime rows around it.
readonly property bool picked: panel.focusIndex === index && !panel.addSelected readonly property bool picked: panel.focusIndex === index && !panel.addSelected
readonly property bool lit: rowHover.hovered || picked readonly property bool lit: rowHover.hovered || picked
color: Model.mix(Color.popups.background, foreground, color: Model.mix(Commons.Color.popups.background, foreground,
picked ? dayFill + hoverLift : rowHover.hovered ? phaseFill + hoverLift : phaseFill) picked ? dayFill + hoverLift : rowHover.hovered ? phaseFill + hoverLift : phaseFill)
// Transforms leave the Column's layout alone: the knock that clears the // Transforms leave the Column's layout alone: the knock that clears the
@@ -297,8 +298,8 @@ Rectangle {
anchors.verticalCenter: parent.top anchors.verticalCenter: parent.top
size: fontSize + (Style.space(22) - fontSize) * 0.85 size: fontSize + (Style.space(22) - fontSize) * 0.85
radius: size / 2 radius: size / 2
color: Model.mix(Color.popups.background, row.foreground, _hot ? 0.24 : 0.14) color: Model.mix(Commons.Color.popups.background, row.foreground, _hot ? 0.24 : 0.14)
borderSpec: Border.flat(Model.mix(Color.popups.background, row.foreground, _hot ? 0.65 : 0.35), Style.space(1)) borderSpec: Border.flat(Model.mix(Commons.Color.popups.background, row.foreground, _hot ? 0.65 : 0.35), Style.space(1))
iconText: "\u00d7" iconText: "\u00d7"
tooltipText: "Remove" tooltipText: "Remove"
foreground: row.dim foreground: row.dim
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "Model.js" as Model import "Model.js" as Model
@@ -20,7 +21,7 @@ Column {
property string placeholderText: "Search cities\u2026" property string placeholderText: "Search cities\u2026"
property string loadingText: "Loading zones\u2026" property string loadingText: "Loading zones\u2026"
property real fontSize: Style.font.bodySmall property real fontSize: Style.font.bodySmall
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color dim: Qt.darker(foreground, 1.55) property color dim: Qt.darker(foreground, 1.55)
property color fainter: Qt.darker(foreground, 2.1) property color fainter: Qt.darker(foreground, 2.1)
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "Model.js" as Model import "Model.js" as Model
import "Sun.js" as Sun import "Sun.js" as Sun
@@ -22,7 +23,7 @@ Item {
property bool hovered: false property bool hovered: false
property bool hour24: false property bool hour24: false
property real moonPhase: 0 property real moonPhase: 0
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color fainter: Qt.darker(foreground, 2.1) property color fainter: Qt.darker(foreground, 2.1)
property color daylightMarker: "#E5C736" property color daylightMarker: "#E5C736"
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
+9 -8
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "GlobeModel.js" as Solar import "GlobeModel.js" as Solar
import "Model.js" as Model import "Model.js" as Model
@@ -11,14 +12,14 @@ import "Model.js" as Model
Item { Item {
id: root id: root
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color dim: Qt.darker(foreground, 1.55) property color dim: Qt.darker(foreground, 1.55)
property color fainter: Qt.darker(foreground, 2.1) property color fainter: Qt.darker(foreground, 2.1)
property color daylightMarker property color daylightMarker
// Passed in so the footer's moon agrees with the rows' strips. // Passed in so the footer's moon agrees with the rows' strips.
property real moonPhase: 0.5 property real moonPhase: 0.5
// Night dots are dark so they read against the bright continents. // Night dots are dark so they read against the bright continents.
readonly property color nightMarker: Util.alpha(Color.background, 0.92) readonly property color nightMarker: Util.alpha(Commons.Color.background, 0.92)
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property bool hour24: false property bool hour24: false
// The panel's offset setting, and the offset "home" is measured from. // The panel's offset setting, and the offset "home" is measured from.
@@ -30,7 +31,7 @@ Item {
property real chromeOpacity: 1 property real chromeOpacity: 1
// Opaque tones mixed against the background, so the rows behind never show through. // Opaque tones mixed against the background, so the rows behind never show through.
readonly property color surfaceBase: Color.popups.background readonly property color surfaceBase: Commons.Color.popups.background
// Light names over sea, dark over land, split at the coastline. // Light names over sea, dark over land, split at the coastline.
readonly property color seaInk: foreground readonly property color seaInk: foreground
readonly property color landInk: surfaceBase readonly property color landInk: surfaceBase
@@ -470,26 +471,26 @@ Item {
ctx.fillStyle = day ? root.daylightMarker : root.nightMarker ctx.fillStyle = day ? root.daylightMarker : root.nightMarker
ctx.fill() ctx.fill()
ctx.lineWidth = root.scaled(1.2) ctx.lineWidth = root.scaled(1.2)
ctx.strokeStyle = day ? Util.alpha(Color.background, 0.7) : Util.alpha(fg, 0.85) ctx.strokeStyle = day ? Util.alpha(Commons.Color.background, 0.7) : Util.alpha(fg, 0.85)
ctx.stroke() ctx.stroke()
if (root.isHome(i)) { if (root.isHome(i)) {
ctx.beginPath() ctx.beginPath()
ctx.arc(p.x, p.y, root.scaled(3.4), 0, Math.PI * 2) ctx.arc(p.x, p.y, root.scaled(3.4), 0, Math.PI * 2)
ctx.fillStyle = Color.accent ctx.fillStyle = Commons.Color.accent
ctx.fill() ctx.fill()
ctx.lineWidth = root.scaled(1.2) ctx.lineWidth = root.scaled(1.2)
ctx.strokeStyle = Util.alpha(Color.background, 0.5) ctx.strokeStyle = Util.alpha(Commons.Color.background, 0.5)
ctx.stroke() ctx.stroke()
ctx.beginPath() ctx.beginPath()
ctx.arc(p.x, p.y, root.scaled(6.4), 0, Math.PI * 2) ctx.arc(p.x, p.y, root.scaled(6.4), 0, Math.PI * 2)
ctx.lineWidth = root.scaled(1.4) ctx.lineWidth = root.scaled(1.4)
ctx.strokeStyle = Util.alpha(Color.accent, 0.65) ctx.strokeStyle = Util.alpha(Commons.Color.accent, 0.65)
ctx.stroke() ctx.stroke()
} else if (root.isTracked(i)) { } else if (root.isTracked(i)) {
ctx.beginPath() ctx.beginPath()
ctx.arc(p.x, p.y, root.scaled(4.6), 0, Math.PI * 2) ctx.arc(p.x, p.y, root.scaled(4.6), 0, Math.PI * 2)
ctx.lineWidth = root.scaled(1.3) ctx.lineWidth = root.scaled(1.3)
ctx.strokeStyle = Color.accent ctx.strokeStyle = Commons.Color.accent
ctx.stroke() ctx.stroke()
} }
if (isSel) { if (isSel) {
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
// The selected city under the globe: name, local time and badge, then its // The selected city under the globe: name, local time and badge, then its
// zone and offset. Blank without a selection; the parent reserves the height. // zone and offset. Blank without a selection; the parent reserves the height.
@@ -12,7 +13,7 @@ Item {
property string offsetLabel: "" property string offsetLabel: ""
property string badge: "" // "home", "tracked" or "" property string badge: "" // "home", "tracked" or ""
property real moonPhase: 0.5 property real moonPhase: 0.5
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color dim: Qt.darker(foreground, 1.55) property color dim: Qt.darker(foreground, 1.55)
property color fainter: Qt.darker(foreground, 2.1) property color fainter: Qt.darker(foreground, 2.1)
property color daylightMarker property color daylightMarker
@@ -90,7 +91,7 @@ Item {
textFormat: Text.PlainText textFormat: Text.PlainText
text: root.badge text: root.badge
visible: root.has && text !== "" visible: root.has && text !== ""
color: Color.accent color: Commons.Color.accent
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.caption font.pixelSize: Style.font.caption
} }
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "GlobeModel.js" as Solar import "GlobeModel.js" as Solar
// "World [globe] Clock" under an arched caption. The little globe is the door // "World [globe] Clock" under an arched caption. The little globe is the door
@@ -10,7 +11,7 @@ Column {
property string caption: "" property string caption: ""
property color captionColor: dim property color captionColor: dim
property bool captionClickable: false property bool captionClickable: false
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color dim: Qt.darker(foreground, 1.55) property color dim: Qt.darker(foreground, 1.55)
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
+5 -4
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "GlobeModel.js" as Solar import "GlobeModel.js" as Solar
import "Model.js" as Model import "Model.js" as Model
@@ -11,7 +12,7 @@ Item {
id: root id: root
property real spin: 0 property real spin: 0
property color color: Color.foreground property color color: Commons.Color.foreground
// Below this size land turns to noise; draw the graticule alone. // Below this size land turns to noise; draw the graticule alone.
readonly property bool showLand: width >= 22 readonly property bool showLand: width >= 22
@@ -24,7 +25,7 @@ Item {
property bool showMarker: false property bool showMarker: false
property real markerLat: 0 property real markerLat: 0
property real markerLon: 0 property real markerLon: 0
property color markerColor: Color.accent property color markerColor: Commons.Color.accent
readonly property real radius: Math.min(width, height) / 2 - 1 readonly property real radius: Math.min(width, height) / 2 - 1
readonly property string pluginDir: Quickshell.env("OMARCHY_PATH") + "/shell/plugins/panels/elsewhen" readonly property string pluginDir: Quickshell.env("OMARCHY_PATH") + "/shell/plugins/panels/elsewhen"
@@ -68,7 +69,7 @@ Item {
// The ocean, opaque like the large globe. // The ocean, opaque like the large globe.
ctx.beginPath() ctx.beginPath()
ctx.arc(0, 0, r, 0, Math.PI * 2) ctx.arc(0, 0, r, 0, Math.PI * 2)
ctx.fillStyle = Model.mix(Color.popups.background, c, root.bold ? 0.16 : 0.13) ctx.fillStyle = Model.mix(Commons.Color.popups.background, c, root.bold ? 0.16 : 0.13)
ctx.fill() ctx.fill()
ctx.save() ctx.save()
@@ -117,7 +118,7 @@ Item {
ctx.fill() ctx.fill()
// Edged so it does not dissolve into a continent of similar lightness. // Edged so it does not dissolve into a continent of similar lightness.
ctx.lineWidth = Math.max(1, r * 0.04) ctx.lineWidth = Math.max(1, r * 0.04)
ctx.strokeStyle = Util.alpha(Color.background, 0.5) ctx.strokeStyle = Util.alpha(Commons.Color.background, 0.5)
ctx.stroke() ctx.stroke()
ctx.beginPath() ctx.beginPath()
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "GlobeModel.js" as Solar import "GlobeModel.js" as Solar
// The night marker drawn as the moon's current phase. The faint full disc // The night marker drawn as the moon's current phase. The faint full disc
@@ -8,7 +9,7 @@ Item {
id: root id: root
property real phase: 0 // 0 new, 0.25 first quarter, 0.5 full property real phase: 0 // 0 new, 0.25 first quarter, 0.5 full
property color color: Color.foreground property color color: Commons.Color.foreground
onPhaseChanged: canvas.requestPaint() onPhaseChanged: canvas.requestPaint()
onColorChanged: canvas.requestPaint() onColorChanged: canvas.requestPaint()
+3 -2
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "Model.js" as Model import "Model.js" as Model
import "GlobeModel.js" as Solar import "GlobeModel.js" as Solar
@@ -80,7 +81,7 @@ Panel {
implicitWidth: button.implicitWidth implicitWidth: button.implicitWidth
implicitHeight: button.implicitHeight implicitHeight: button.implicitHeight
readonly property color foreground: bar ? bar.foreground : Color.foreground readonly property color foreground: bar ? bar.foreground : Commons.Color.foreground
readonly property color dim: Qt.darker(foreground, 1.55) readonly property color dim: Qt.darker(foreground, 1.55)
readonly property color fainter: Qt.darker(foreground, 2.1) readonly property color fainter: Qt.darker(foreground, 2.1)
// A literal gold: several themes' "yellow" is not yellow. // A literal gold: several themes' "yellow" is not yellow.
@@ -830,7 +831,7 @@ Panel {
width: parent.width width: parent.width
caption: root.hereLine caption: root.hereLine
// Accent while scrubbed, so a shifted time is never taken for now. // Accent while scrubbed, so a shifted time is never taken for now.
captionColor: root.scrubMinutes !== 0 ? Color.accent : root.dim captionColor: root.scrubMinutes !== 0 ? Commons.Color.accent : root.dim
captionClickable: root.focusIndex >= 0 captionClickable: root.focusIndex >= 0
foreground: root.foreground foreground: root.foreground
dim: root.dim dim: root.dim
+3 -2
View File
@@ -4,6 +4,7 @@ import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Ui import qs.Ui
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "Model.js" as Model import "Model.js" as Model
Panel { Panel {
@@ -873,8 +874,8 @@ Panel {
onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(monitorRow) onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(monitorRow)
current: isFocused current: isFocused
foreground: root.bar.foreground foreground: root.bar.foreground
fill: Style.hoverFillFor(root.bar.foreground, Color.accent) fill: Style.hoverFillFor(root.bar.foreground, Commons.Color.accent)
currentFill: Style.selectedFillFor(root.bar.foreground, Color.accent) currentFill: Style.selectedFillFor(root.bar.foreground, Commons.Color.accent)
implicitHeight: monitorInner.implicitHeight + Style.spacing.xl implicitHeight: monitorInner.implicitHeight + Style.spacing.xl
opacity: canToggle ? 1.0 : 0.45 opacity: canToggle ? 1.0 : 0.45
+4 -3
View File
@@ -6,6 +6,7 @@ import Quickshell.Io
import Quickshell.Networking import Quickshell.Networking
import qs.Ui import qs.Ui
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "Model.js" as Model import "Model.js" as Model
Panel { Panel {
@@ -291,8 +292,8 @@ Panel {
// `selectedIndex`). Mouse hover and keyboard nav both mutate this state // `selectedIndex`). Mouse hover and keyboard nav both mutate this state
// at the root; items never read containsMouse for visuals. See // at the root; items never read containsMouse for visuals. See
// CursorSurface for the shared chrome shared by rows and pills. // CursorSurface for the shared chrome shared by rows and pills.
readonly property color hoverFill: bar ? Style.hoverFillFor(bar.foreground, Color.accent) : "transparent" readonly property color hoverFill: bar ? Style.hoverFillFor(bar.foreground, Commons.Color.accent) : "transparent"
readonly property color selectedFill: bar ? Style.selectedFillFor(bar.foreground, Color.accent) : "transparent" readonly property color selectedFill: bar ? Style.selectedFillFor(bar.foreground, Commons.Color.accent) : "transparent"
// scannerEnabled lives on the shared WifiDevice, which has no reference // scannerEnabled lives on the shared WifiDevice, which has no reference
// counting, and a bar widget is instantiated once per monitor. Tracking the // counting, and a bar widget is instantiated once per monitor. Tracking the
@@ -2078,7 +2079,7 @@ Panel {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
height: Style.spacing.controlHeight height: Style.spacing.controlHeight
color: Style.normalFillFor(root.bar.foreground) color: Style.normalFillFor(root.bar.foreground)
borderSpec: Border.controlSpec("normal", root.bar.foreground, Color.accent) borderSpec: Border.controlSpec("normal", root.bar.foreground, Commons.Color.accent)
radius: Style.cornerRadius radius: Style.cornerRadius
Text { Text {
+2 -1
View File
@@ -3,6 +3,7 @@ import Quickshell
import Quickshell.Io import Quickshell.Io
import Quickshell.Services.UPower import Quickshell.Services.UPower
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "Model.js" as Model import "Model.js" as Model
@@ -88,7 +89,7 @@ Panel {
} }
readonly property color batteryFillColor: { readonly property color batteryFillColor: {
return root.bar ? root.bar.foreground : Color.foreground return root.bar ? root.bar.foreground : Commons.Color.foreground
} }
// Cute agent-flavored phrases shown in the hero status line, rotated on a // Cute agent-flavored phrases shown in the hero status line, rotated on a
+6 -5
View File
@@ -4,6 +4,7 @@ import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
Panel { Panel {
@@ -37,8 +38,8 @@ Panel {
] ]
readonly property string heroPhraseText: activePhrases[phraseIndex % activePhrases.length] readonly property string heroPhraseText: activePhrases[phraseIndex % activePhrases.length]
readonly property color foreground: bar ? bar.foreground : Color.foreground readonly property color foreground: bar ? bar.foreground : Commons.Color.foreground
readonly property color urgent: bar ? bar.urgent : Color.urgent readonly property color urgent: bar ? bar.urgent : Commons.Color.urgent
readonly property color dim: Qt.darker(foreground, 1.55) readonly property color dim: Qt.darker(foreground, 1.55)
readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family
readonly property bool showConnections: tailscale.accounts.length > 1 || tailscale.accountsAccessDenied readonly property bool showConnections: tailscale.accounts.length > 1 || tailscale.accountsAccessDenied
@@ -54,8 +55,8 @@ Panel {
readonly property color iconColor: tailscale.active ? foreground : dim readonly property color iconColor: tailscale.active ? foreground : dim
readonly property string toggleHint: tailscale.active ? "Turn Tailscale off" : (tailscale.needsLogin ? "Authorize this device" : "Turn Tailscale on") readonly property string toggleHint: tailscale.active ? "Turn Tailscale off" : (tailscale.needsLogin ? "Authorize this device" : "Turn Tailscale on")
readonly property color barIconColor: tailscale.active ? barForeground : Qt.darker(barForeground, 1.55) readonly property color barIconColor: tailscale.active ? barForeground : Qt.darker(barForeground, 1.55)
readonly property color hoverFill: bar ? Style.hoverFillFor(bar.foreground, Color.accent) : "transparent" readonly property color hoverFill: bar ? Style.hoverFillFor(bar.foreground, Commons.Color.accent) : "transparent"
readonly property color selectedFill: bar ? Style.selectedFillFor(bar.foreground, Color.accent) : "transparent" readonly property color selectedFill: bar ? Style.selectedFillFor(bar.foreground, Commons.Color.accent) : "transparent"
function selectedPeer() { function selectedPeer() {
if (tailscale.peers.length === 0) return null if (tailscale.peers.length === 0) return null
@@ -1035,7 +1036,7 @@ Panel {
} }
} }
background: BorderSurface { background: BorderSurface {
color: Color.background color: Commons.Color.background
borderSpec: Border.flat(root.dim, 1) borderSpec: Border.flat(root.dim, 1)
radius: Style.cornerRadius radius: Style.cornerRadius
} }
@@ -1,13 +1,14 @@
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
Item { Item {
id: root id: root
property real iconSize: Style.font.icon property real iconSize: Style.font.icon
property color color: Color.foreground property color color: Commons.Color.foreground
property color badgeColor: Color.urgent property color badgeColor: Commons.Color.urgent
property bool crossed: false property bool crossed: false
property bool warning: false property bool warning: false
@@ -51,12 +52,12 @@ Item {
color: root.badgeColor color: root.badgeColor
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
borderSpec: Border.flat(Color.popups.background, 1) borderSpec: Border.flat(Commons.Color.popups.background, 1)
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
text: "!" text: "!"
color: Color.background color: Commons.Color.background
font.family: Style.font.family font.family: Style.font.family
font.pixelSize: Math.max(6, parent.height * 0.72) font.pixelSize: Math.max(6, parent.height * 0.72)
font.bold: true font.bold: true
+4 -3
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "Model.js" as Model import "Model.js" as Model
@@ -646,7 +647,7 @@ Panel {
height: Style.space(18) height: Style.space(18)
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
radius: Math.min(4, Style.cornerRadius) radius: Math.min(4, Style.cornerRadius)
color: !root.savingLocation && clearLocationArea.containsMouse ? Style.hoverFillFor(root.bar.foreground, Color.accent) : "transparent" color: !root.savingLocation && clearLocationArea.containsMouse ? Style.hoverFillFor(root.bar.foreground, Commons.Color.accent) : "transparent"
Text { Text {
textFormat: Text.PlainText textFormat: Text.PlainText
@@ -752,7 +753,7 @@ Panel {
width: parent.width width: parent.width
height: suggestionRow.implicitHeight + Style.space(12) height: suggestionRow.implicitHeight + Style.space(12)
radius: Style.cornerRadius radius: Style.cornerRadius
color: index === root.suggestionIndex ? Style.hoverFillFor(root.bar.foreground, Color.accent) : "transparent" color: index === root.suggestionIndex ? Style.hoverFillFor(root.bar.foreground, Commons.Color.accent) : "transparent"
Row { Row {
id: suggestionRow id: suggestionRow
@@ -764,7 +765,7 @@ Panel {
Text { Text {
textFormat: Text.PlainText textFormat: Text.PlainText
text: modelData.name text: modelData.name
color: index === root.suggestionIndex ? Style.hoverStateColor(root.bar.foreground, Color.accent) : root.bar.foreground color: index === root.suggestionIndex ? Style.hoverStateColor(root.bar.foreground, Commons.Color.accent) : root.bar.foreground
font.family: root.bar.fontFamily font.family: root.bar.fontFamily
font.pixelSize: Style.font.body font.pixelSize: Style.font.body
} }
+13 -12
View File
@@ -4,6 +4,7 @@ import Quickshell.Io
import Quickshell.Services.Polkit import Quickshell.Services.Polkit
import Quickshell.Wayland import Quickshell.Wayland
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "PolkitModel.js" as PolkitModel import "PolkitModel.js" as PolkitModel
@@ -11,14 +12,14 @@ Item {
id: root id: root
property string fontFamily: Style.font.menuFamily property string fontFamily: Style.font.menuFamily
// Bound to the central [polkit] section in shell.toml via Color.qml. // Bound to the central [polkit] section in shell.toml via Commons.Color.qml.
property color accent: Color.polkit.accent property color accent: Commons.Color.polkit.accent
property color background: Color.polkit.background property color background: Commons.Color.polkit.background
property color foreground: Color.polkit.text property color foreground: Commons.Color.polkit.text
property color border: Color.polkit.border property color border: Commons.Color.polkit.border
property color borderError: Color.polkit.borderError property color borderError: Commons.Color.polkit.borderError
property var borderSpec: Border.surfaceSpec("polkit", errorFlash ? "border-error" : "border", errorFlash ? borderError : border, Math.max(1, Style.space(2)), "border-alpha") property var borderSpec: Border.surfaceSpec("polkit", errorFlash ? "border-error" : "border", errorFlash ? borderError : border, Math.max(1, Style.space(2)), "border-alpha")
property color scrim: Color.polkit.scrim property color scrim: Commons.Color.polkit.scrim
readonly property int cornerRadius: Style.cornerRadius readonly property int cornerRadius: Style.cornerRadius
property int contentMargin: Style.spacing.panelPadding property int contentMargin: Style.spacing.panelPadding
property int fieldHeight: Math.max(Style.space(42), Style.spacing.controlHeight) property int fieldHeight: Math.max(Style.space(42), Style.spacing.controlHeight)
@@ -278,7 +279,7 @@ Item {
text: "\udb80\ude37" text: "\udb80\ude37"
fontFamily: root.fontFamily fontFamily: root.fontFamily
fontSize: Math.round(root.fieldHeight * 0.7) fontSize: Math.round(root.fieldHeight * 0.7)
color: root.errorFlash ? Color.polkit.textError : root.accent color: root.errorFlash ? Commons.Color.polkit.textError : root.accent
} }
Row { Row {
@@ -293,7 +294,7 @@ Item {
Text { Text {
text: "\uf023" text: "\uf023"
color: root.errorFlash ? Color.polkit.textError : root.accent color: root.errorFlash ? Commons.Color.polkit.textError : root.accent
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.iconLarge font.pixelSize: Style.font.iconLarge
width: Style.space(26) width: Style.space(26)
@@ -318,7 +319,7 @@ Item {
font.pixelSize: Style.font.iconLarge font.pixelSize: Style.font.iconLarge
echoMode: root.responseVisible ? TextInput.Normal : TextInput.Password echoMode: root.responseVisible ? TextInput.Normal : TextInput.Password
passwordCharacter: "\u2022" passwordCharacter: "\u2022"
color: root.errorFlash ? Color.polkit.textError : root.foreground color: root.errorFlash ? Commons.Color.polkit.textError : root.foreground
cursorVisible: activeFocus && !root.submitted && !root.errorFlash cursorVisible: activeFocus && !root.submitted && !root.errorFlash
readOnly: root.submitted || root.errorFlash readOnly: root.submitted || root.errorFlash
enabled: root.dialogVisible enabled: root.dialogVisible
@@ -337,7 +338,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: root.errorFlash ? "Wrong" : (root.submitted ? "Checking..." : "Enter password") text: root.errorFlash ? "Wrong" : (root.submitted ? "Checking..." : "Enter password")
color: root.errorFlash ? Color.polkit.textError : root.foreground color: root.errorFlash ? Commons.Color.polkit.textError : root.foreground
opacity: root.errorFlash ? 1 : 0.36 opacity: root.errorFlash ? 1 : 0.36
font.family: root.fontFamily font.family: root.fontFamily
font.pixelSize: Style.font.iconLarge font.pixelSize: Style.font.iconLarge
@@ -350,7 +351,7 @@ Item {
height: Style.space(24) height: Style.space(24)
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: root.errorFlash ? Color.polkit.textError : root.foreground color: root.errorFlash ? Commons.Color.polkit.textError : root.foreground
visible: passwordInput.visible && passwordInput.activeFocus && passwordInput.text.length === 0 && !root.submitted && !root.errorFlash visible: passwordInput.visible && passwordInput.activeFocus && passwordInput.text.length === 0 && !root.submitted && !root.errorFlash
} }
+5 -4
View File
@@ -2,6 +2,7 @@ import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import QtQuick import QtQuick
import qs.Commons import qs.Commons
import qs.Commons as Commons
import qs.Ui import qs.Ui
import "ReminderFlowModel.js" as ReminderFlowModel import "ReminderFlowModel.js" as ReminderFlowModel
@@ -18,11 +19,11 @@ Item {
property string filterText: "" property string filterText: ""
property string fontFamily: Style.font.menuFamily property string fontFamily: Style.font.menuFamily
property color background: Color.menu.background property color background: Commons.Color.menu.background
property color foreground: Color.menu.text property color foreground: Commons.Color.menu.text
property color border: Color.menu.border property color border: Commons.Color.menu.border
property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2))) property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2)))
property color scrim: Color.menu.scrim property color scrim: Commons.Color.menu.scrim
readonly property int cornerRadius: Style.cornerRadius readonly property int cornerRadius: Style.cornerRadius
property int contentMargin: Style.spacing.panelPadding property int contentMargin: Style.spacing.panelPadding
property int headerHeight: Math.max(Style.space(34), Style.font.title + Style.spacing.controlPaddingY * 2) property int headerHeight: Math.max(Style.space(34), Style.font.title + Style.spacing.controlPaddingY * 2)
+5 -4
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import qs.Ui import qs.Ui
import qs.Commons import qs.Commons
import qs.Commons as Commons
BarWidget { BarWidget {
id: root id: root
@@ -125,8 +126,8 @@ BarWidget {
width: Style.space(64) width: Style.space(64)
height: Style.space(64) height: Style.space(64)
radius: Style.spacing.labelGap radius: Style.spacing.labelGap
color: Style.normalFillFor(root.bar.foreground, Color.accent) color: Style.normalFillFor(root.bar.foreground, Commons.Color.accent)
borderSpec: Border.controlSpec("normal", root.bar.foreground, Color.accent) borderSpec: Border.controlSpec("normal", root.bar.foreground, Commons.Color.accent)
Image { Image {
anchors.fill: parent anchors.fill: parent
@@ -249,8 +250,8 @@ BarWidget {
width: sourceList.width width: sourceList.width
height: sourceInner.implicitHeight + Style.space(10) height: sourceInner.implicitHeight + Style.space(10)
radius: Style.spacing.labelGap radius: Style.spacing.labelGap
color: selected ? Style.selectedFillFor(root.bar.foreground, Color.accent) : "transparent" color: selected ? Style.selectedFillFor(root.bar.foreground, Commons.Color.accent) : "transparent"
borderSpec: selected ? Border.controlSpec("normal", root.bar.foreground, Color.accent) : Border.none() borderSpec: selected ? Border.controlSpec("normal", root.bar.foreground, Commons.Color.accent) : Border.none()
Row { Row {
id: sourceInner id: sourceInner
+4 -3
View File
@@ -3,6 +3,7 @@ import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
// Keep startup and theme covers alive across background service handoffs. // Keep startup and theme covers alive across background service handoffs.
Item { Item {
@@ -80,8 +81,8 @@ Item {
framePoll.stop() framePoll.stop()
themeFallback.stop() themeFallback.stop()
if (themeToken) { if (themeToken) {
Color.loadColors(Util.decodeBase64(themeColors)) Commons.Color.loadColors(Util.decodeBase64(themeColors))
Color.loadShell(Util.decodeBase64(themeShell)) Commons.Color.loadShell(Util.decodeBase64(themeShell))
Style.scheduleRefresh() Style.scheduleRefresh()
} }
cover = false cover = false
@@ -289,7 +290,7 @@ Item {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
visible: root.cover visible: root.cover
color: Color.background color: Commons.Color.background
} }
Image { Image {
+3 -2
View File
@@ -5,6 +5,7 @@ import Quickshell.Hyprland
import Quickshell.Io import Quickshell.Io
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "plugins/bar" import "plugins/bar"
import "services" import "services"
@@ -1745,8 +1746,8 @@ ShellRoot {
var shellRaw = "" var shellRaw = ""
try { colorsRaw = Qt.atob(String(colorsB64 || "")) } catch (e) { colorsRaw = "" } try { colorsRaw = Qt.atob(String(colorsB64 || "")) } catch (e) { colorsRaw = "" }
try { shellRaw = Qt.atob(String(shellB64 || "")) } catch (e2) { shellRaw = "" } try { shellRaw = Qt.atob(String(shellB64 || "")) } catch (e2) { shellRaw = "" }
Color.loadColors(colorsRaw) Commons.Color.loadColors(colorsRaw)
Color.loadShell(shellRaw) Commons.Color.loadShell(shellRaw)
Style.scheduleRefresh() Style.scheduleRefresh()
return "ok" return "ok"
} }
+1 -1
View File
@@ -282,7 +282,7 @@ assert(
'bar uses nearest insertion targeting for widget and free-space drops' 'bar uses nearest insertion targeting for widget and free-space drops'
) )
assert( assert(
/component DragGhostPanel:[\s\S]*?readonly property var targetRect: root\.barDragTargetGeometry[\s\S]*?color: Color\.accent/.test(barSource), /component DragGhostPanel:[\s\S]*?readonly property var targetRect: root\.barDragTargetGeometry[\s\S]*?color: Commons\.Color\.accent/.test(barSource),
'bar draws the insertion marker above the bar in the drag overlay' 'bar draws the insertion marker above the bar in the drag overlay'
) )
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "background" as BackgroundPlugin import "background" as BackgroundPlugin
ShellRoot { ShellRoot {
@@ -24,10 +25,10 @@ ShellRoot {
interval: 1300 interval: 1300
running: true running: true
onTriggered: { onTriggered: {
if (Qt.colorEqual(Color.accent, "#123456")) { if (Qt.colorEqual(Commons.Color.accent, "#123456")) {
console.log("RESULT pass") console.log("RESULT pass")
} else { } else {
console.log("RESULT fail previous colors returned: " + Color.accent) console.log("RESULT fail previous colors returned: " + Commons.Color.accent)
} }
Qt.quit() Qt.quit()
} }
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell import Quickshell
import Quickshell.Networking import Quickshell.Networking
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "mocks" import "mocks"
import "network" as Network import "network" as Network
@@ -21,9 +22,9 @@ ShellRoot {
Network.Panel { Network.Panel {
id: panel id: panel
bar: QtObject { bar: QtObject {
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color barForeground: Color.foreground property color barForeground: Commons.Color.foreground
property color urgent: Color.urgent property color urgent: Commons.Color.urgent
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property string position: "top" property string position: "top"
property int barSize: 24 property int barSize: 24
@@ -1,6 +1,7 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import qs.Commons import qs.Commons
import qs.Commons as Commons
import "mocks" import "mocks"
import "network" as Network import "network" as Network
import "network/Model.js" as Model import "network/Model.js" as Model
@@ -25,9 +26,9 @@ ShellRoot {
Network.Panel { Network.Panel {
id: panel id: panel
bar: QtObject { bar: QtObject {
property color foreground: Color.foreground property color foreground: Commons.Color.foreground
property color barForeground: Color.foreground property color barForeground: Commons.Color.foreground
property color urgent: Color.urgent property color urgent: Commons.Color.urgent
property string fontFamily: Style.font.family property string fontFamily: Style.font.family
property string position: "top" property string position: "top"
property int barSize: 24 property int barSize: 24
@@ -11,7 +11,7 @@ const widget = read('shell/plugins/bar/widgets/Indicators.qml')
const manifest = JSON.parse(read('shell/plugins/bar/widgets/Indicators.manifest.json')) const manifest = JSON.parse(read('shell/plugins/bar/widgets/Indicators.manifest.json'))
assert(widget.match(/defaultIndicatorEntries: \[ "PasswordlessSudo", "Dictation"/), 'passwordless sudo is included in the default indicator tray') assert(widget.match(/defaultIndicatorEntries: \[ "PasswordlessSudo", "Dictation"/), 'passwordless sudo is included in the default indicator tray')
assert(manifest.barWidget.schema.find(field => field.key === 'items').options.some(option => option.value === 'PasswordlessSudo'), 'passwordless sudo is configurable alongside Night Light') assert(manifest.barWidget.schema.find(field => field.key === 'items').options.some(option => option.value === 'PasswordlessSudo'), 'passwordless sudo is configurable alongside Night Light')
assert(indicator.includes('useActiveColor: true') && indicator.includes('activeColor: Color.urgent'), 'active passwordless sudo uses the theme danger color') assert(indicator.includes('useActiveColor: true') && indicator.includes('activeColor: Commons.Color.urgent'), 'active passwordless sudo uses the theme danger color')
assertEqual(indicator.match(/activeText: "([^"]+)"/)[1], indicator.match(/inactiveText: "([^"]+)"/)[1], 'sudo keeps the same icon in both states') assertEqual(indicator.match(/activeText: "([^"]+)"/)[1], indicator.match(/inactiveText: "([^"]+)"/)[1], 'sudo keeps the same icon in both states')
assert(!widget.includes('sudoHorizontal') && !widget.includes('sudoVertical'), 'sudo participates in the normal indicator blocks') assert(!widget.includes('sudoHorizontal') && !widget.includes('sudoVertical'), 'sudo participates in the normal indicator blocks')
assert(!indicator.includes('visible:'), 'sudo uses the shared indicator visibility and hover behavior') assert(!indicator.includes('visible:'), 'sudo uses the shared indicator visibility and hover behavior')