feat: complete quickshell redesign

This commit is contained in:
johannes committed 2026-09-21 16:16:35 +02:00
1 parent 1eb0820083
commit 0ff727898a
25 files changed
+1410 -401

No files matched your search

@@ -1,8 +1,7 @@
import QtQuick
import QtQuick.Effects
import "."
Rectangle {
Surface {
id: button
// "primary" | "secondary" | "accent" | "destructive" | "success" | "warning" | "info"
@@ -13,7 +12,7 @@ Rectangle {
// primary and accent are the same color (Theme.colors.primary === .accent);
// kept as separate variant names for call-site clarity.
readonly property bool filled: variant === "primary" || variant === "accent"
readonly property color tint: variant === "accent" ? Theme.colors.accent
readonly property color variantColor: variant === "accent" ? Theme.colors.accent
: variant === "destructive" ? Theme.colors.alert
: variant === "success" ? Theme.colors.success
: variant === "warning" ? Theme.colors.warning
@@ -22,35 +21,27 @@ Rectangle {
implicitWidth: label.implicitWidth + Theme.geometry.padding * 2
implicitHeight: label.implicitHeight + Theme.geometry.padding
width: implicitWidth
height: implicitHeight
radius: Theme.geometry.radiusSmall
color: filled
? (mouseArea.pressed ? Qt.darker(tint, 1.1) : tint)
: (mouseArea.containsMouse ? Qt.alpha(tint, 0.22) : Qt.alpha(tint, 0.15))
border.width: filled ? 0 : 1
border.color: Qt.alpha(tint, 0.3)
layer.enabled: filled
layer.effect: MultiEffect {
shadowEnabled: true
shadowColor: button.tint
shadowOpacity: Theme.elevation.medium.opacity
shadowBlur: Theme.elevation.medium.blur
shadowVerticalOffset: 2
}
? (mouseArea.containsMouse ? Qt.lighter(variantColor, 1.15) : variantColor)
: (mouseArea.containsMouse ? Theme.colors.surfaceHover : Theme.colors.surface)
tint: variantColor
glow: !filled && mouseArea.containsMouse
pressed: mouseArea.pressed
Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } }
Behavior on scale { SpringAnimation { spring: Theme.motion.springSnappy.spring; damping: Theme.motion.springSnappy.damping } }
scale: mouseArea.pressed ? 0.97 : 1.0
Text {
id: label
anchors.centerIn: parent
text: button.text
font.family: Theme.font.family
font.pixelSize: 13
font.family: Theme.font.headlineFamily
font.pixelSize: 14
font.bold: true
color: button.filled ? Theme.colors.background : button.tint
font.capitalization: Font.AllUppercase
color: button.filled ? Theme.colors.textOnAccent : button.variantColor
}
MouseArea {
@@ -0,0 +1,36 @@
import QtQuick
import "."
// 18x18 square checkbox with a 10x10 solid core when checked, per
// DESIGN.md's Checkboxes spec.
Item {
id: box
// Controlled component - see ToggleSwitch.qml.
property bool checked: false
signal toggled()
implicitWidth: 18
implicitHeight: 18
Rectangle {
anchors.fill: parent
color: Theme.colors.surface
border.width: Theme.geometry.borderWidth
border.color: Theme.colors.crust
Rectangle {
width: 10
height: 10
anchors.centerIn: parent
color: Theme.colors.primary
visible: box.checked
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: box.toggled()
}
}
@@ -14,7 +14,7 @@ Rectangle {
radius: Theme.geometry.radiusMedium
color: Theme.colors.background
border.color: Theme.colors.border
border.width: 1
border.width: Theme.geometry.borderWidth
height: column.implicitHeight + Theme.geometry.spacing
function openAt(px, py) {
@@ -1,7 +1,7 @@
import QtQuick
import "."
// Row of "key label" keyboard hints shown under launcher-style overlays,
// Row of "[KEY] label" keyboard hints shown under launcher-style overlays,
// e.g. [ [↑↓, "Navigate"], ["↵", "Launch"], ["Esc", "Close"] ].
Row {
id: hintBar
@@ -16,12 +16,16 @@ Row {
delegate: Row {
spacing: Theme.geometry.spacing / 2
Text {
text: modelData.key
color: Theme.colors.textMuted
font.family: Theme.font.family
font.bold: true
font.pixelSize: Theme.type.caption
Pill {
tint: Theme.colors.outlineVariant
Text {
text: "[" + modelData.key + "]"
color: Theme.colors.text
font.family: Theme.font.family
font.bold: true
font.pixelSize: Theme.type.caption
}
}
Text {
@@ -29,6 +33,7 @@ Row {
color: Theme.colors.textMuted
font.family: Theme.font.family
font.pixelSize: Theme.type.caption
anchors.verticalCenter: parent.verticalCenter
}
}
}
@@ -1,8 +1,8 @@
import QtQuick
import "."
// Selectable list row: a colored left accent bar plus a tinted background
// when current, shared by CommandPalette and ClipboardManager so both
// Selectable list row: solid accent fill + crust text when selected (not a
// soft tint), shared by CommandPalette and ClipboardManager so both
// launchers read as the same design language.
Rectangle {
id: row
@@ -16,25 +16,20 @@ Rectangle {
signal entered()
height: 40
radius: Theme.geometry.radiusTiny
color: selected ? Qt.alpha(accent, 0.16) : "transparent"
color: selected ? accent : (hovered ? Theme.colors.surfaceHover : "transparent")
border.width: selected ? Theme.geometry.borderWidth : 0
border.color: Theme.colors.crust
Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } }
Rectangle {
width: 3
height: parent.height - 10
anchors.verticalCenter: parent.verticalCenter
width: 4
height: parent.height
anchors.left: parent.left
radius: 2
color: row.accent
opacity: row.selected ? 1 : 0
Behavior on opacity { NumberAnimation { duration: Theme.animation.durationFast } }
color: Theme.colors.crust
visible: row.selected
}
// Declared before contentItem so any interactive child placed in
// `content` (e.g. a hover delete button) stacks on top and can
// intercept clicks before they fall through to this row-wide handler.
MouseArea {
id: rowMouse
anchors.fill: parent
@@ -47,7 +42,9 @@ Rectangle {
Item {
id: contentItem
anchors.fill: parent
anchors.leftMargin: Theme.geometry.padding + 4
anchors.leftMargin: Theme.geometry.padding + ((row.selected || row.hovered) ? 8 : 4)
anchors.rightMargin: Theme.geometry.padding
Behavior on anchors.leftMargin { NumberAnimation { duration: Theme.animation.durationFast; easing.type: Easing.Linear } }
}
}
@@ -1,54 +1,46 @@
import QtQuick
import QtQuick.Effects
import "."
// Bar-style pill chrome: rounded surface, border, optional colored glow.
// Children are centered in an internal Row - place them directly as this
// component's children, same as putting them in a Row.
Rectangle {
// Status chip / telemetry badge: sharp corners, 2px border, a tight 2px
// offset shadow (deliberately smaller than Surface's, per DESIGN.md's
// "Status Chips & Telemetry Badges" spec). Children are centered in an
// internal Row - place them directly as this component's children, same as
// putting them in a Row.
Item {
id: pill
property color tint: Theme.colors.border
property color tint: Theme.colors.outlineVariant
property bool glow: false
// How strongly `tint` is mixed into the base surface color, so each
// pill reads as its own tinted background instead of one flat surface
// color with only the border/glow varying.
property real tintStrength: 0.35
default property alias content: contentRow.data
function blend(base, mix, amount) {
return Qt.rgba(
base.r + (mix.r - base.r) * amount,
base.g + (mix.g - base.g) * amount,
base.b + (mix.b - base.b) * amount,
base.a
);
}
readonly property color edgeColor: glow ? tint : Theme.colors.crust
readonly property int offset: 2
implicitWidth: contentRow.implicitWidth + Theme.geometry.padding * 2
implicitHeight: contentRow.implicitHeight + Theme.geometry.padding
implicitWidth: contentRow.implicitWidth + Theme.geometry.padding * 2 + offset
implicitHeight: contentRow.implicitHeight + Theme.geometry.spacing + offset
height: implicitHeight
radius: Theme.geometry.pillRadius
color: blend(Theme.colors.surface, tint, tintStrength)
border.color: tint
border.width: 1
Behavior on color { ColorAnimation { duration: Theme.animation.durationNormal } }
Behavior on border.color { ColorAnimation { duration: Theme.animation.durationFast } }
layer.enabled: glow
layer.effect: MultiEffect {
shadowEnabled: true
shadowColor: pill.tint
shadowOpacity: Theme.elevation.low.opacity
shadowBlur: Theme.elevation.low.blur
shadowVerticalOffset: 1
Rectangle {
x: pill.offset
y: pill.offset
width: pill.width - pill.offset
height: pill.height - pill.offset
color: pill.edgeColor
}
Row {
id: contentRow
anchors.centerIn: parent
spacing: Theme.geometry.spacing
Rectangle {
width: pill.width - pill.offset
height: pill.height - pill.offset
color: Theme.colors.surface
border.width: Theme.geometry.borderWidth
border.color: pill.edgeColor
Behavior on border.color { ColorAnimation { duration: Theme.animation.durationFast } }
Row {
id: contentRow
anchors.centerIn: parent
spacing: Theme.geometry.spacing
}
}
}
@@ -1,25 +1,28 @@
import QtQuick
import "."
// Colored fill bar for OSD volume/brightness and similar level readouts.
// Sharp-cornered track+fill for OSD volume/brightness and similar level
// readouts, and the base for slider-style controls in Quick Settings.
Item {
id: bar
property real value: 0 // 0..1
property color fillColor: Theme.colors.primary
height: 8
height: 10
Rectangle {
anchors.fill: parent
color: Theme.colors.surfaceHover
radius: height / 2
border.width: Theme.geometry.borderWidth
border.color: Theme.colors.crust
clip: true
Rectangle {
width: parent.width * Math.max(0, Math.min(1, bar.value))
height: parent.height
radius: parent.radius
width: Math.max(0, parent.width * Math.max(0, Math.min(1, bar.value)) - parent.border.width * 2)
height: parent.height - parent.border.width * 2
x: parent.border.width
y: parent.border.width
color: bar.fillColor
Behavior on width { NumberAnimation { duration: Theme.animation.durationFast } }
@@ -1,26 +1,47 @@
import QtQuick
import QtQuick.Effects
import "."
// Base panel/card chrome shared by menus, pickers, and dialogs: rounded
// background, border, optional colored glow.
Rectangle {
// Base panel/card chrome shared by menus, pickers, and dialogs: sharp
// corners, a solid 2px border, and a hard offset "shadow" - a flat duplicate
// rectangle displaced down-right, never blurred. `glow` switches the border
// and shadow from the default crust to `tint` (DESIGN.md's "Focused /
// Active" state, also used for danger/selected emphasis). `pressed`
// collapses the shadow and slides the face onto it - the mechanical
// depression press effect. Children declared on a Surface instance attach
// to the face, not the outer Item, so they translate together with it.
Item {
id: surface
property color tint: Theme.colors.border
default property alias content: face.data
property alias color: face.color
property color tint: Theme.colors.primary
property bool glow: false
property bool pressed: false
radius: Theme.geometry.radiusMedium
color: Theme.colors.background
border.color: tint
border.width: 1
readonly property int offset: glow ? Theme.elevation.high : Theme.elevation.low
readonly property color edgeColor: glow ? tint : Theme.colors.crust
layer.enabled: glow
layer.effect: MultiEffect {
shadowEnabled: true
shadowColor: surface.tint
shadowOpacity: Theme.elevation.medium.opacity
shadowBlur: Theme.elevation.medium.blur
shadowVerticalOffset: 2
Rectangle {
id: shadow
x: surface.offset
y: surface.offset
width: surface.width
height: surface.height
color: surface.edgeColor
visible: !surface.pressed
}
Rectangle {
id: face
x: surface.pressed ? surface.offset : 0
y: surface.pressed ? surface.offset : 0
width: surface.width
height: surface.height
color: Theme.colors.background
border.width: Theme.geometry.borderWidth
border.color: surface.edgeColor
Behavior on x { NumberAnimation { duration: Theme.animation.durationFast; easing.type: Easing.Linear } }
Behavior on y { NumberAnimation { duration: Theme.animation.durationFast; easing.type: Easing.Linear } }
}
}
@@ -1,17 +1,18 @@
import QtQuick
import QtQuick.Effects
import "."
// Search/filter input with an animated focus border + glow, shared by
// Search/filter input with a hard focus border + shadow, shared by
// CommandPalette and ClipboardManager. Navigation is exposed as signals
// (rather than exposing the inner TextInput's Keys handlers directly) so
// each caller can wire up its own list navigation.
Rectangle {
Item {
id: field
property alias text: input.text
property alias echoMode: input.echoMode
property alias passwordCharacter: input.passwordCharacter
property string placeholder: ""
property string prefix: ""
signal escapePressed()
signal upPressed()
@@ -21,6 +22,12 @@ Rectangle {
function focusInput() { input.forceActiveFocus(); }
readonly property bool focused: input.activeFocus
readonly property color edgeColor: focused ? Theme.colors.primary : Theme.colors.crust
readonly property int offset: focused ? Theme.elevation.high : Theme.elevation.low
height: 50
// The layer-shell surface only gets real keyboard focus from the
// compositor asynchronously after it's first mapped, so a single
// forceActiveFocus() call right on visible-toggle can silently lose
@@ -34,51 +41,70 @@ Rectangle {
onTriggered: input.forceActiveFocus()
}
height: 50
color: Theme.colors.surface
radius: Theme.geometry.radiusSmall
border.width: 1
border.color: input.activeFocus ? Theme.colors.primary : Theme.colors.border
Behavior on border.color { ColorAnimation { duration: Theme.animation.durationFast } }
layer.enabled: input.activeFocus
layer.effect: MultiEffect {
shadowEnabled: true
shadowColor: Theme.colors.primary
shadowOpacity: Theme.elevation.low.opacity
shadowBlur: Theme.elevation.low.blur
shadowHorizontalOffset: 0
shadowVerticalOffset: 0
Rectangle {
x: field.offset
y: field.offset
width: field.width
height: field.height
color: field.edgeColor
}
TextInput {
id: input
anchors.fill: parent
anchors.margins: Theme.geometry.padding
verticalAlignment: TextInput.AlignVCenter
font.family: Theme.font.family
font.pixelSize: 18
color: Theme.colors.text
clip: true
Rectangle {
width: field.width
height: field.height
color: Theme.colors.surface
border.width: Theme.geometry.borderWidth
border.color: field.edgeColor
Behavior on border.color { ColorAnimation { duration: Theme.animation.durationFast } }
Text {
text: field.placeholder
color: Theme.colors.textMuted
id: prefixText
text: field.prefix
visible: field.prefix.length > 0
color: Theme.colors.secondary
font.family: Theme.font.family
font.bold: true
font.pixelSize: 18
anchors.left: parent.left
anchors.leftMargin: Theme.geometry.padding
anchors.verticalCenter: parent.verticalCenter
visible: input.text.length === 0
}
Keys.onEscapePressed: (event) => { field.escapePressed(); event.accepted = true; }
Keys.onUpPressed: (event) => { field.upPressed(); event.accepted = true; }
Keys.onDownPressed: (event) => { field.downPressed(); event.accepted = true; }
Keys.onReturnPressed: (event) => { field.returnPressed(); event.accepted = true; }
Keys.onPressed: (event) => {
if (event.key === Qt.Key_Delete || (event.key === Qt.Key_Backspace && input.text.length === 0)) {
field.deleteRequested();
event.accepted = true;
TextInput {
id: input
anchors.fill: parent
anchors.margins: Theme.geometry.padding
anchors.leftMargin: field.prefix.length > 0 ? prefixText.width + Theme.geometry.padding + Theme.geometry.spacing / 2 : Theme.geometry.padding
verticalAlignment: TextInput.AlignVCenter
font.family: Theme.font.family
font.pixelSize: 18
color: Theme.colors.text
clip: true
cursorDelegate: Rectangle {
width: 9
color: Theme.colors.primary
}
Text {
text: field.placeholder
color: Theme.colors.textMuted
font.family: Theme.font.family
font.pixelSize: 18
anchors.verticalCenter: parent.verticalCenter
visible: input.text.length === 0
}
Keys.onEscapePressed: (event) => { field.escapePressed(); event.accepted = true; }
Keys.onUpPressed: (event) => { field.upPressed(); event.accepted = true; }
Keys.onDownPressed: (event) => { field.downPressed(); event.accepted = true; }
Keys.onReturnPressed: (event) => { field.returnPressed(); event.accepted = true; }
Keys.onPressed: (event) => {
if (event.key === Qt.Key_Delete || (event.key === Qt.Key_Backspace && input.text.length === 0)) {
field.deleteRequested();
event.accepted = true;
}
}
}
}
@@ -5,61 +5,70 @@ QtObject {
id: theme
// Regenerated by wallpaper-theme.nu on every wallpaper change - don't
// hand-edit between these markers, it gets overwritten.
// hand-edit between these markers, it gets overwritten. Colors are
// always opaque (no alpha blending) per the neo-brutalist system: solid
// blocks, no soft/translucent surfaces. `overlay` is the one exception
// (a full-screen dimming scrim, not a card surface).
// GENERATED:COLORS:BEGIN
property QtObject colors: QtObject {
property color background: "#e611111b"
property color surface: "#cc181825"
property color surfaceHover: "#f2313244"
property color overlay: "#6011111b"
property color background: "#1e1e2e"
property color surface: "#181825"
property color surfaceHover: "#313244"
property color overlay: "#cc11111b"
property color primary: "#74c7ec"
property color crust: "#11111b"
property color outlineVariant: "#45475a"
property color primary: "#eba0ac"
property color secondary: "#cba6f7"
property color tertiary: "#a6e3a1"
property color accent: "#74c7ec"
property color tertiary: "#f2cdcd"
property color accent: "#eba0ac"
property color primaryContainer: "#2474c7ec"
property color secondaryContainer: "#24cba6f7"
property color tertiaryContainer: "#24a6e3a1"
property color primaryContainer: "#695363"
property color secondaryContainer: "#5f557a"
property color tertiaryContainer: "#6b616d"
property color alert: "#f38ba8"
property color alertContainer: "#24f38ba8"
property color alertContainer: "#6b4d62"
property color success: "#a6e3a1"
property color successContainer: "#24a6e3a1"
property color successContainer: "#546760"
property color warning: "#f9e2af"
property color warningContainer: "#24f9e2af"
property color warningContainer: "#6d6764"
property color info: "#74c7ec"
property color infoContainer: "#2474c7ec"
property color infoContainer: "#455f76"
property color text: "#cdd6f4"
property color textMuted: "#a6adc8"
property color textOnAccent: "#e611111b"
property color textOnAccent: "#11111b"
property color border: "#1a74c7ec"
property color border: "#11111b"
}
// GENERATED:COLORS:END
property QtObject geometry: QtObject {
property int radiusTiny: 6
property int radiusSmall: 8
property int radiusMedium: 10
property int pillRadius: 100
property int radiusTiny: 0
property int radiusSmall: 0
property int radiusMedium: 0
property int pillRadius: 0
property int padding: 12
property int spacing: 8
property int borderWidth: 2
}
property QtObject animation: QtObject {
property int durationFast: 150
property int durationNormal: 250
property int durationSlow: 400
property int durationFast: 100
property int durationNormal: 150
property int durationSlow: 250
}
// Named spring presets, so call sites stop hand-rolling
// `SpringAnimation { spring: 4; damping: 0.3 }` with slightly different
// numbers each time.
property QtObject motion: QtObject {
property QtObject springSnappy: QtObject { property real spring: 4; property real damping: 0.3 }
property QtObject springSoft: QtObject { property real spring: 3; property real damping: 0.2 }
// Hard offset-shadow steps (px), replacing the old blur/glow elevation
// system. No blur, ever - depth comes from a flat displaced duplicate
// rectangle. `high` is used for the focused/active accent-colored
// variant; `overlay` for big floating surfaces (launcher, modals).
property QtObject elevation: QtObject {
property int low: 4
property int high: 6
property int overlay: 8
}
// Type scale. Family stays fixed - this is only about size/weight steps.
@@ -77,15 +86,8 @@ QtObject {
property int large: 24
}
// Named shadow presets for MultiEffect glows, keyed by how prominent the
// glow should read (e.g. hover vs. focus vs. an always-on active state).
property QtObject elevation: QtObject {
property QtObject low: QtObject { property real blur: 0.4; property real opacity: 0.35 }
property QtObject medium: QtObject { property real blur: 0.6; property real opacity: 0.5 }
property QtObject high: QtObject { property real blur: 0.8; property real opacity: 0.65 }
}
property QtObject font: QtObject {
property string family: "JetBrainsMono Nerd Font"
property string headlineFamily: "Plus Jakarta Sans"
}
}
@@ -0,0 +1,44 @@
import QtQuick
import "."
// Rectangular tray + square thumb toggle, per DESIGN.md: 36x20 tray, 12x12
// thumb that translates (never curves) between two hard-stop positions.
Item {
id: toggle
// Controlled component: clicking never mutates `checked` itself, it
// only requests a change via `toggled()` - the caller owns the real
// state (usually a live system property) and rebinds `checked` to it.
property bool checked: false
property color onColor: Theme.colors.success
signal toggled()
implicitWidth: 36
implicitHeight: 20
Rectangle {
anchors.fill: parent
color: toggle.checked ? toggle.onColor : Theme.colors.surface
border.width: Theme.geometry.borderWidth
border.color: Theme.colors.crust
Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } }
Rectangle {
id: thumb
width: 12
height: 12
y: (parent.height - height) / 2
x: toggle.checked ? parent.width - width - 4 : 4
color: Theme.colors.crust
Behavior on x { NumberAnimation { duration: Theme.animation.durationFast; easing.type: Easing.Linear } }
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: toggle.toggled()
}
}
@@ -11,7 +11,7 @@ Rectangle {
radius: Theme.geometry.radiusMedium
color: Theme.colors.background
border.color: Theme.colors.border
border.width: 1
border.width: Theme.geometry.borderWidth
width: label.implicitWidth + Theme.geometry.padding * 2
height: label.implicitHeight + Theme.geometry.padding
@@ -9,3 +9,5 @@ Tooltip 1.0 Tooltip.qml
Showcase 1.0 Showcase.qml
ListRow 1.0 ListRow.qml
HintBar 1.0 HintBar.qml
ToggleSwitch 1.0 ToggleSwitch.qml
Checkbox 1.0 Checkbox.qml