feat: colorful multi-accent quickshell design system
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A8TNMgnEa7Kia5Wcz2kyDx
This commit is contained in:
1 parent
5a004b8be5
commit
215d8b7d8e
23 files changed
+1073
-577
No files matched your search
@@ -5,7 +5,7 @@ import "."
|
||||
Rectangle {
|
||||
id: button
|
||||
|
||||
// "primary" | "secondary" | "accent" | "destructive"
|
||||
// "primary" | "secondary" | "accent" | "destructive" | "success" | "warning" | "info"
|
||||
property string variant: "primary"
|
||||
property string text: ""
|
||||
signal clicked()
|
||||
@@ -15,6 +15,9 @@ Rectangle {
|
||||
readonly property bool filled: variant === "primary" || variant === "accent"
|
||||
readonly property color tint: variant === "accent" ? Theme.colors.accent
|
||||
: variant === "destructive" ? Theme.colors.alert
|
||||
: variant === "success" ? Theme.colors.success
|
||||
: variant === "warning" ? Theme.colors.warning
|
||||
: variant === "info" ? Theme.colors.info
|
||||
: Theme.colors.primary
|
||||
|
||||
implicitWidth: label.implicitWidth + Theme.geometry.padding * 2
|
||||
@@ -31,13 +34,13 @@ Rectangle {
|
||||
layer.effect: MultiEffect {
|
||||
shadowEnabled: true
|
||||
shadowColor: button.tint
|
||||
shadowOpacity: 0.5
|
||||
shadowBlur: 0.6
|
||||
shadowOpacity: Theme.elevation.medium.opacity
|
||||
shadowBlur: Theme.elevation.medium.blur
|
||||
shadowVerticalOffset: 2
|
||||
}
|
||||
|
||||
Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } }
|
||||
Behavior on scale { SpringAnimation { spring: 4; damping: 0.3 } }
|
||||
Behavior on scale { SpringAnimation { spring: Theme.motion.springSnappy.spring; damping: Theme.motion.springSnappy.damping } }
|
||||
scale: mouseArea.pressed ? 0.97 : 1.0
|
||||
|
||||
Text {
|
||||
|
||||
@@ -57,15 +57,16 @@ Rectangle {
|
||||
|
||||
Text {
|
||||
text: modelData.icon || ""
|
||||
width: 14
|
||||
font.pixelSize: 12
|
||||
width: Theme.iconSize.small
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: Theme.type.caption
|
||||
color: modelData.destructive ? Theme.colors.alert : Theme.colors.text
|
||||
}
|
||||
|
||||
Text {
|
||||
text: modelData.label || ""
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: 12
|
||||
font.pixelSize: Theme.type.caption
|
||||
color: modelData.destructive ? Theme.colors.alert : Theme.colors.text
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import QtQuick
|
||||
import "."
|
||||
|
||||
// Row of "key label" keyboard hints shown under launcher-style overlays,
|
||||
// e.g. [ [↑↓, "Navigate"], ["↵", "Launch"], ["Esc", "Close"] ].
|
||||
Row {
|
||||
id: hintBar
|
||||
|
||||
property var hints: []
|
||||
|
||||
spacing: Theme.geometry.spacing * 2
|
||||
|
||||
Repeater {
|
||||
model: hintBar.hints
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
Text {
|
||||
text: modelData.label
|
||||
color: Theme.colors.textMuted
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: Theme.type.caption
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import QtQuick
|
||||
import "."
|
||||
|
||||
// Selectable list row: a colored left accent bar plus a tinted background
|
||||
// when current, shared by CommandPalette and ClipboardManager so both
|
||||
// launchers read as the same design language.
|
||||
Rectangle {
|
||||
id: row
|
||||
|
||||
property bool selected: false
|
||||
property color accent: Theme.colors.primary
|
||||
readonly property alias hovered: rowMouse.containsMouse
|
||||
default property alias content: contentItem.data
|
||||
|
||||
signal clicked(var mouse)
|
||||
signal entered()
|
||||
|
||||
height: 40
|
||||
radius: Theme.geometry.radiusTiny
|
||||
color: selected ? Qt.alpha(accent, 0.16) : "transparent"
|
||||
|
||||
Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } }
|
||||
|
||||
Rectangle {
|
||||
width: 3
|
||||
height: parent.height - 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
radius: 2
|
||||
color: row.accent
|
||||
opacity: row.selected ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { duration: Theme.animation.durationFast } }
|
||||
}
|
||||
|
||||
// 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
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onEntered: row.entered()
|
||||
onClicked: (mouse) => row.clicked(mouse)
|
||||
}
|
||||
|
||||
Item {
|
||||
id: contentItem
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Theme.geometry.padding + 4
|
||||
anchors.rightMargin: Theme.geometry.padding
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
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 {
|
||||
id: pill
|
||||
|
||||
property color tint: Theme.colors.border
|
||||
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
|
||||
);
|
||||
}
|
||||
|
||||
implicitWidth: contentRow.implicitWidth + Theme.geometry.padding * 2
|
||||
implicitHeight: contentRow.implicitHeight + Theme.geometry.padding
|
||||
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
|
||||
}
|
||||
|
||||
Row {
|
||||
id: contentRow
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.geometry.spacing
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import QtQuick
|
||||
import "."
|
||||
|
||||
// Colored fill bar for OSD volume/brightness and similar level readouts.
|
||||
Item {
|
||||
id: bar
|
||||
|
||||
property real value: 0 // 0..1
|
||||
property color fillColor: Theme.colors.primary
|
||||
|
||||
height: 8
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Theme.colors.surfaceHover
|
||||
radius: height / 2
|
||||
clip: true
|
||||
|
||||
Rectangle {
|
||||
width: parent.width * Math.max(0, Math.min(1, bar.value))
|
||||
height: parent.height
|
||||
radius: parent.radius
|
||||
color: bar.fillColor
|
||||
|
||||
Behavior on width { NumberAnimation { duration: Theme.animation.durationFast } }
|
||||
Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "."
|
||||
|
||||
// Live reference for the shared design-language kit: every Shared/
|
||||
// component in one place, so future surfaces (notification center, lock
|
||||
// screen, dashboard) have something concrete to copy from instead of
|
||||
// reverse-engineering an existing feature component.
|
||||
PanelWindow {
|
||||
id: showcaseWindow
|
||||
|
||||
property bool open: false
|
||||
visible: open
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
bottom: true
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
|
||||
exclusiveZone: 0
|
||||
color: "transparent"
|
||||
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
WlrLayershell.namespace: "quickshell-showcase"
|
||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: showcaseWindow.open = false
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Theme.colors.overlay
|
||||
}
|
||||
|
||||
Surface {
|
||||
anchors.centerIn: parent
|
||||
width: 640
|
||||
height: content.implicitHeight + Theme.geometry.padding * 2
|
||||
glow: true
|
||||
|
||||
MouseArea { anchors.fill: parent }
|
||||
|
||||
Column {
|
||||
id: content
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.geometry.padding
|
||||
spacing: Theme.geometry.spacing * 2
|
||||
|
||||
Text {
|
||||
text: "Design language showcase"
|
||||
color: Theme.colors.text
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: Theme.type.title
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Row {
|
||||
spacing: Theme.geometry.spacing
|
||||
Pill { tint: Theme.colors.primary; glow: true; Text { text: "primary"; color: Theme.colors.text; font.family: Theme.font.family } }
|
||||
Pill { tint: Theme.colors.secondary; glow: true; Text { text: "secondary"; color: Theme.colors.text; font.family: Theme.font.family } }
|
||||
Pill { tint: Theme.colors.tertiary; glow: true; Text { text: "tertiary"; color: Theme.colors.text; font.family: Theme.font.family } }
|
||||
}
|
||||
|
||||
Row {
|
||||
spacing: Theme.geometry.spacing
|
||||
Button { variant: "primary"; text: "Primary" }
|
||||
Button { variant: "secondary"; text: "Secondary" }
|
||||
Button { variant: "success"; text: "Success" }
|
||||
Button { variant: "warning"; text: "Warning" }
|
||||
Button { variant: "info"; text: "Info" }
|
||||
Button { variant: "destructive"; text: "Destructive" }
|
||||
}
|
||||
|
||||
TextField {
|
||||
width: parent.width
|
||||
placeholder: "TextField..."
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.geometry.spacing
|
||||
ProgressBar { width: parent.width; value: 0.7; fillColor: Theme.colors.primary }
|
||||
ProgressBar { width: parent.width; value: 0.4; fillColor: Theme.colors.warning }
|
||||
ProgressBar { width: parent.width; value: 0.9; fillColor: Theme.colors.success }
|
||||
}
|
||||
|
||||
Tooltip { text: "Tooltip bubble" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import "."
|
||||
|
||||
// Base panel/card chrome shared by menus, pickers, and dialogs: rounded
|
||||
// background, border, optional colored glow.
|
||||
Rectangle {
|
||||
id: surface
|
||||
|
||||
property color tint: Theme.colors.border
|
||||
property bool glow: false
|
||||
|
||||
radius: Theme.geometry.radiusMedium
|
||||
color: Theme.colors.background
|
||||
border.color: tint
|
||||
border.width: 1
|
||||
|
||||
layer.enabled: glow
|
||||
layer.effect: MultiEffect {
|
||||
shadowEnabled: true
|
||||
shadowColor: surface.tint
|
||||
shadowOpacity: Theme.elevation.medium.opacity
|
||||
shadowBlur: Theme.elevation.medium.blur
|
||||
shadowVerticalOffset: 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import "."
|
||||
|
||||
// Search/filter input with an animated focus border + glow, 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 {
|
||||
id: field
|
||||
|
||||
property alias text: input.text
|
||||
property string placeholder: ""
|
||||
|
||||
signal escapePressed()
|
||||
signal upPressed()
|
||||
signal downPressed()
|
||||
signal returnPressed()
|
||||
signal deleteRequested()
|
||||
|
||||
function focusInput() { 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
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,20 +13,32 @@ QtObject {
|
||||
property color surfaceHover: "#f2313244"
|
||||
property color overlay: "#6011111b"
|
||||
|
||||
property color primary: "#74c7ec"
|
||||
property color secondary: "#b4befe"
|
||||
property color accent: "#74c7ec"
|
||||
property color primary: "#cba6f7"
|
||||
property color secondary: "#f5c2e7"
|
||||
property color tertiary: "#89b4fa"
|
||||
property color accent: "#cba6f7"
|
||||
|
||||
property color primaryContainer: "#24cba6f7"
|
||||
property color secondaryContainer: "#24f5c2e7"
|
||||
property color tertiaryContainer: "#2489b4fa"
|
||||
|
||||
property color alert: "#f38ba8"
|
||||
property color alertContainer: "#24f38ba8"
|
||||
property color success: "#a6e3a1"
|
||||
property color successContainer: "#24a6e3a1"
|
||||
property color warning: "#f9e2af"
|
||||
property color warningContainer: "#24f9e2af"
|
||||
property color info: "#74c7ec"
|
||||
property color infoContainer: "#2474c7ec"
|
||||
|
||||
property color text: "#cdd6f4"
|
||||
property color textMuted: "#a6adc8"
|
||||
property color textOnAccent: "#e611111b"
|
||||
|
||||
property color border: "#1a74c7ec"
|
||||
property color border: "#1acba6f7"
|
||||
}
|
||||
// GENERATED:COLORS:END
|
||||
|
||||
|
||||
property QtObject geometry: QtObject {
|
||||
property int radiusTiny: 6
|
||||
property int radiusSmall: 8
|
||||
@@ -35,13 +47,44 @@ QtObject {
|
||||
property int padding: 12
|
||||
property int spacing: 8
|
||||
}
|
||||
|
||||
|
||||
property QtObject animation: QtObject {
|
||||
property int durationFast: 150
|
||||
property int durationNormal: 250
|
||||
property int durationSlow: 400
|
||||
}
|
||||
|
||||
|
||||
// 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 }
|
||||
}
|
||||
|
||||
// Type scale. Family stays fixed - this is only about size/weight steps.
|
||||
property QtObject type: QtObject {
|
||||
property int caption: 11
|
||||
property int body: 13
|
||||
property int label: 14
|
||||
property int title: 18
|
||||
property int display: 24
|
||||
}
|
||||
|
||||
property QtObject iconSize: QtObject {
|
||||
property int small: 14
|
||||
property int medium: 18
|
||||
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"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import QtQuick
|
||||
import "."
|
||||
|
||||
// Shared tooltip bubble visual. Host inside a click-through overlay
|
||||
// PanelWindow (see Bar/TrayTooltip.qml) - this only draws the label chrome.
|
||||
Rectangle {
|
||||
id: bubble
|
||||
|
||||
property string text: ""
|
||||
|
||||
radius: Theme.geometry.radiusMedium
|
||||
color: Theme.colors.background
|
||||
border.color: Theme.colors.border
|
||||
border.width: 1
|
||||
width: label.implicitWidth + Theme.geometry.padding * 2
|
||||
height: label.implicitHeight + Theme.geometry.padding
|
||||
|
||||
Text {
|
||||
id: label
|
||||
anchors.centerIn: parent
|
||||
text: bubble.text
|
||||
color: Theme.colors.text
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: Theme.type.caption
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,11 @@
|
||||
singleton Theme 1.0 Theme.qml
|
||||
Button 1.0 Button.qml
|
||||
ContextMenu 1.0 ContextMenu.qml
|
||||
Surface 1.0 Surface.qml
|
||||
Pill 1.0 Pill.qml
|
||||
TextField 1.0 TextField.qml
|
||||
ProgressBar 1.0 ProgressBar.qml
|
||||
Tooltip 1.0 Tooltip.qml
|
||||
Showcase 1.0 Showcase.qml
|
||||
ListRow 1.0 ListRow.qml
|
||||
HintBar 1.0 HintBar.qml
|
||||
Reference in new issue
Block a user