From e818b1c1eab3821090ed3a544e1202ae7a2f6591 Mon Sep 17 00:00:00 2001 From: Johannes Kresner Date: Sat, 29 Aug 2026 16:16:22 +0200 Subject: [PATCH] feat: colorful multi-accent quickshell design system Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01A8TNMgnEa7Kia5Wcz2kyDx --- config/nushell/scripts/wallpaper-theme.nu | 155 +++++-- mutable_config/btop/btop.conf | 2 +- .../quickshell/components/Bar/Bar.qml | 239 +++++------ .../quickshell/components/Bar/TrayTooltip.qml | 18 +- .../ClipboardManager/ClipboardManager.qml | 281 +++++++------ .../CommandPalette/CommandPalette.qml | 384 +++++++++--------- .../components/LogoutMenu/LogoutMenu.qml | 25 +- .../Notifications/Notifications.qml | 5 +- .../quickshell/components/OSD/OSD.qml | 52 +-- .../quickshell/components/Shared/Button.qml | 11 +- .../components/Shared/ContextMenu.qml | 7 +- .../quickshell/components/Shared/HintBar.qml | 35 ++ .../quickshell/components/Shared/ListRow.qml | 53 +++ .../quickshell/components/Shared/Pill.qml | 54 +++ .../components/Shared/ProgressBar.qml | 29 ++ .../quickshell/components/Shared/Showcase.qml | 95 +++++ .../quickshell/components/Shared/Surface.qml | 26 ++ .../components/Shared/TextField.qml | 71 ++++ .../quickshell/components/Shared/Theme.qml | 57 ++- .../quickshell/components/Shared/Tooltip.qml | 26 ++ .../quickshell/components/Shared/qmldir | 8 + .../WallpaperPicker/WallpaperPicker.qml | 6 +- mutable_config/quickshell/shell.qml | 11 + 23 files changed, 1073 insertions(+), 577 deletions(-) create mode 100644 mutable_config/quickshell/components/Shared/HintBar.qml create mode 100644 mutable_config/quickshell/components/Shared/ListRow.qml create mode 100644 mutable_config/quickshell/components/Shared/Pill.qml create mode 100644 mutable_config/quickshell/components/Shared/ProgressBar.qml create mode 100644 mutable_config/quickshell/components/Shared/Showcase.qml create mode 100644 mutable_config/quickshell/components/Shared/Surface.qml create mode 100644 mutable_config/quickshell/components/Shared/TextField.qml create mode 100644 mutable_config/quickshell/components/Shared/Tooltip.qml diff --git a/config/nushell/scripts/wallpaper-theme.nu b/config/nushell/scripts/wallpaper-theme.nu index 758a1e3..a02473f 100644 --- a/config/nushell/scripts/wallpaper-theme.nu +++ b/config/nushell/scripts/wallpaper-theme.nu @@ -1,19 +1,16 @@ #!/usr/bin/env nu -# Derives a Catppuccin flavor + accent from a wallpaper's average color and -# applies it system-wide. No manual override - the wallpaper is the source of truth. +# Derives a Catppuccin flavor + a trio of accents from a wallpaper's dominant +# colors and applies it system-wide. No manual override - the wallpaper is +# the source of truth. Colors are always Catppuccin swatches - we only ever +# change *which* swatches get used, never introduce outside colors. def palette [] { open ($"($env.HOME)/.dotfiles/config/themes/catppuccin/palette.json") } -def average-color [path: string] { - let out = (magick $path -resize 1x1 txt:- | lines | skip 1 | first) - let matches = ($out | parse --regex '\((?P\d+),(?P\d+),(?P\d+)\)') - if ($matches | is-empty) { - error make { msg: $"could not read average color from ($path)" } - } - let m = ($matches | first) - { r: ($m.r | into int), g: ($m.g | into int), b: ($m.b | into int) } +def hex-byte [] { + # "into int -r 16" misreads byte pairs like "0b" as a binary literal prefix. + $"0x($in)" | into int } def rgb-to-hsl [rgb: record] { @@ -45,49 +42,106 @@ def rgb-to-hsl [rgb: record] { { h: $h, s: $s, l: $l } } -def hex-byte [] { - # "into int -r 16" misreads byte pairs like "0b" as a binary literal prefix. - $"0x($in)" | into int -} - def hue-dist [a: float, b: float] { let diff = (($a - $b) | math abs) [$diff, 360 - $diff] | math min } +# Wallpaper's dominant colors, ranked by pixel count (descending). Replaces +# the old single 1x1-resize average-color sample, which always produced one +# flat blend no matter how many distinct colors the wallpaper actually had. +def dominant-colors [path: string, n: int] { + let out = (magick $path -resize 100x100 -colors $n +dither -format %c histogram:info:-) + $out + | lines + | parse --regex '(?P\d+):.*#(?P[0-9A-Fa-f]{6})' + | insert count_n { |row| $row.count | into int } + | sort-by count_n --reverse + | each { |row| + let r = ($row.hex | str substring 0..1 | hex-byte) + let g = ($row.hex | str substring 2..3 | hex-byte) + let b = ($row.hex | str substring 4..5 | hex-byte) + { r: $r, g: $g, b: $b, hsl: (rgb-to-hsl { r: $r, g: $g, b: $b }) } + } +} + +def accent-list [flavor: string] { + let accents = (palette | get $flavor | get accents) + $accents + | columns + | each {|name| + let hex = ($accents | get $name) + let r = ($hex | str substring 1..2 | hex-byte) + let g = ($hex | str substring 3..4 | hex-byte) + let b = ($hex | str substring 5..6 | hex-byte) + { name: $name, hsl: (rgb-to-hsl { r: $r, g: $g, b: $b }) } + } +} + def pick-flavor [rgb: record] { let luma = (0.299 * $rgb.r + 0.587 * $rgb.g + 0.114 * $rgb.b) / 255 if $luma < 0.5 { "mocha" } else { "latte" } } -def pick-accent [flavor: string, rgb: record] { - let wallpaper_hsl = (rgb-to-hsl $rgb) +# Maps up to `want` of the wallpaper's dominant swatches onto distinct +# Catppuccin accent swatches (at least `min_sep` degrees of hue apart), so +# the shell gets a coherent multi-accent palette instead of one flat color. +# Near-gray swatches (no meaningful hue) are skipped. If the wallpaper +# doesn't carry enough distinct hues, remaining slots are filled from a +# fixed, pleasant fallback order so the palette never collapses to +# monochrome. +def pick-accents [flavor: string, swatches: list, want: int, min_sep: float] { + let accents = (accent-list $flavor) + mut chosen_names = [] + mut chosen_hues = [] - # Near-gray wallpapers don't carry a meaningful hue - fall back to mauve. - if $wallpaper_hsl.s < 0.12 { - return "mauve" + for sw in $swatches { + if ($chosen_names | length) >= $want { continue } + if $sw.hsl.s < 0.12 { continue } + + let names_snapshot = $chosen_names + let hues_snapshot = $chosen_hues + + let candidates = ( + $accents + | where {|a| not ($names_snapshot | any {|c| $c == $a.name }) } + | each {|a| + let dists_to_chosen = ($hues_snapshot | each {|ch| hue-dist $a.hsl.h $ch }) + let min_dist_to_chosen = if ($dists_to_chosen | is-empty) { 999.0 } else { $dists_to_chosen | math min } + { name: $a.name, dist_to_swatch: (hue-dist $sw.hsl.h $a.hsl.h), min_dist_to_chosen: $min_dist_to_chosen } + } + | where min_dist_to_chosen >= $min_sep + | sort-by dist_to_swatch + ) + + if ($candidates | is-empty) { continue } + let pick = ($candidates | first) + $chosen_names = ($chosen_names | append $pick.name) + $chosen_hues = ($chosen_hues | append (($accents | where name == $pick.name | first).hsl.h)) } - let accents = (palette | get $flavor | get accents) - $accents - | columns - | each {|name| - let hex = ($accents | get $name) - let r = ($hex | str substring 1..2 | hex-byte) - let g = ($hex | str substring 3..4 | hex-byte) - let b = ($hex | str substring 5..6 | hex-byte) - let accent_hsl = (rgb-to-hsl { r: $r, g: $g, b: $b }) - { name: $name, dist: (hue-dist $wallpaper_hsl.h $accent_hsl.h) } - } - | sort-by dist - | first - | get name + let fallback_order = ["mauve" "sapphire" "peach" "green" "pink" "yellow" "teal" "blue" "flamingo"] + for fb in $fallback_order { + if ($chosen_names | length) >= $want { continue } + if ($chosen_names | any {|c| $c == $fb }) { continue } + $chosen_names = ($chosen_names | append $fb) + } + + $chosen_names } -def write-theme-colors [flavor: string, accent_name: string] { +def container-tint [hex: string] { + # accent-tinted, ~14% opacity - a soft fill for badges/containers + $"#24($hex | str substring 1..)" +} + +def write-theme-colors [flavor: string, accent_names: list] { let p = (palette | get $flavor) - let accent = ($p.accents | get $accent_name) - let border = $"#1a($accent | str substring 1..)" # accent-tinted, ~10% opacity + let primary = ($p.accents | get $accent_names.0) + let secondary = ($p.accents | get $accent_names.1) + let tertiary = ($p.accents | get $accent_names.2) + let info = $p.accents.sapphire + let border = $"#1a($primary | str substring 1..)" # accent-tinted, ~10% opacity let colors = [ $" property color background: \"#e6($p.crust | str substring 1..)\"" @@ -95,15 +149,27 @@ def write-theme-colors [flavor: string, accent_name: string] { $" property color surfaceHover: \"#f2($p.surface0 | str substring 1..)\"" $" property color overlay: \"#60($p.crust | str substring 1..)\"" "" - $" property color primary: \"($accent)\"" - $" property color secondary: \"($p.accents.lavender)\"" - $" property color accent: \"($accent)\"" + $" property color primary: \"($primary)\"" + $" property color secondary: \"($secondary)\"" + $" property color tertiary: \"($tertiary)\"" + $" property color accent: \"($primary)\"" + "" + $" property color primaryContainer: \"(container-tint $primary)\"" + $" property color secondaryContainer: \"(container-tint $secondary)\"" + $" property color tertiaryContainer: \"(container-tint $tertiary)\"" + "" $" property color alert: \"($p.red)\"" + $" property color alertContainer: \"(container-tint $p.red)\"" $" property color success: \"($p.green)\"" + $" property color successContainer: \"(container-tint $p.green)\"" $" property color warning: \"($p.yellow)\"" + $" property color warningContainer: \"(container-tint $p.yellow)\"" + $" property color info: \"($info)\"" + $" property color infoContainer: \"(container-tint $info)\"" "" $" property color text: \"($p.text)\"" $" property color textMuted: \"($p.subtext0)\"" + $" property color textOnAccent: \"#e6($p.crust | str substring 1..)\"" "" $" property color border: \"($border)\"" ] @@ -177,10 +243,11 @@ def propagate [flavor: string] { } def main [wallpaper_path: string] { - let rgb = (average-color $wallpaper_path) - let flavor = (pick-flavor $rgb) - let accent = (pick-accent $flavor $rgb) + let swatches = (dominant-colors $wallpaper_path 8) + let top = ($swatches | first) + let flavor = (pick-flavor { r: $top.r, g: $top.g, b: $top.b }) + let accent_names = (pick-accents $flavor $swatches 3 40.0) - write-theme-colors $flavor $accent + write-theme-colors $flavor $accent_names propagate $flavor } diff --git a/mutable_config/btop/btop.conf b/mutable_config/btop/btop.conf index d11ba5a..4d3ed9e 100644 --- a/mutable_config/btop/btop.conf +++ b/mutable_config/btop/btop.conf @@ -68,7 +68,7 @@ update_ms = 1000 #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", #* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. -proc_sorting = "cpu lazy" +proc_sorting = "memory" #* Reverse sorting order, True or False. proc_reversed = false diff --git a/mutable_config/quickshell/components/Bar/Bar.qml b/mutable_config/quickshell/components/Bar/Bar.qml index 767c564..5098ed8 100644 --- a/mutable_config/quickshell/components/Bar/Bar.qml +++ b/mutable_config/quickshell/components/Bar/Bar.qml @@ -8,7 +8,7 @@ import "../Shared" PanelWindow { id: barWindow - + // Reference to global state property QtObject rootState // Shared overlay window that renders tray icon hover tooltips (see @@ -43,66 +43,56 @@ PanelWindow { WlrLayershell.layer: WlrLayer.Top WlrLayershell.namespace: "quickshell-bar" - // Left Pill (Workspaces + Battery) - Rectangle { + // Left Pill (Workspaces) - tinted with the primary accent. + Pill { id: leftPill anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter height: parent.height - width: leftPillRow.width + Theme.geometry.padding * 2 - radius: Theme.geometry.pillRadius - color: Theme.colors.surface - border.color: Theme.colors.border - border.width: 1 + tint: Theme.colors.primary + glow: true + // Workspaces Row { - id: leftPillRow - anchors.centerIn: parent spacing: Theme.geometry.spacing - - // Workspaces - Row { - spacing: Theme.geometry.spacing - Repeater { - model: Hyprland.workspaces.values - - delegate: Rectangle { - width: 24 - height: 24 - radius: Theme.geometry.radiusTiny - color: modelData.active ? Theme.colors.primary : Theme.colors.surfaceHover - - Text { - anchors.centerIn: parent - text: modelData.id - color: modelData.active ? Theme.colors.background : Theme.colors.text - font.family: Theme.font.family - font.pixelSize: 12 - font.bold: modelData.active - } - - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onClicked: modelData.activate() - } + Repeater { + model: Hyprland.workspaces.values + + delegate: Rectangle { + width: 24 + height: 24 + radius: Theme.geometry.radiusTiny + color: modelData.active ? Theme.colors.primary : Theme.colors.surfaceHover + + Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } } + + Text { + anchors.centerIn: parent + text: modelData.id + color: modelData.active ? Theme.colors.textOnAccent : Theme.colors.text + font.family: Theme.font.family + font.pixelSize: Theme.type.caption + font.bold: modelData.active + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: modelData.activate() } } } } } - // Center Pill (Clock) - Rectangle { + // Center Pill (Clock) - tinted with the secondary accent. + Pill { id: centerPill anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter height: parent.height - width: clockText.width + Theme.geometry.padding * 4 - radius: Theme.geometry.pillRadius - color: Theme.colors.surface - border.color: Theme.colors.border - border.width: 1 + tint: Theme.colors.secondary + glow: true SystemClock { id: clock @@ -111,88 +101,94 @@ PanelWindow { Text { id: clockText - anchors.centerIn: parent text: Qt.formatDateTime(clock.date, "hh:mm") - color: Theme.colors.text + color: Theme.colors.secondary font.family: Theme.font.family font.bold: true } } - // Right Pill (System tray: WiFi, Bluetooth, Battery) - // Hidden entirely when none of the tray icons have anything to show. - Rectangle { + // Right Pill (System tray: CPU/RAM/temp stats, WiFi, Bluetooth, Battery) + // Tinted with the tertiary accent; each stat/icon also carries its own + // color so the pill reads as a set of distinct signals, not one blob. + Pill { id: rightPill anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter height: parent.height - width: rightPillRow.width + Theme.geometry.padding * 2 - radius: Theme.geometry.pillRadius - color: Theme.colors.surface - border.color: Theme.colors.border - border.width: 1 + tint: Theme.colors.tertiary - Row { - id: rightPillRow - anchors.centerIn: parent - spacing: Theme.geometry.spacing + StatIndicator { + glyph: "" // nf-fa-microchip + text: sysStats.cpuPercent + "%" + tint: Theme.colors.tertiary + tooltip: "CPU usage: " + sysStats.cpuPercent + "%" + tooltipWindow: barWindow.trayTooltip + } - StatIndicator { - glyph: "" // nf-fa-microchip - text: sysStats.cpuPercent + "%" - tooltip: "CPU usage: " + sysStats.cpuPercent + "%" - tooltipWindow: barWindow.trayTooltip + StatIndicator { + visible: sysStats.cpuTemp.length > 0 + glyph: "" // nf-fa-thermometer_half + text: sysStats.cpuTemp + "°" + tint: { + let t = Number(sysStats.cpuTemp); + if (t >= 80) return Theme.colors.alert; + if (t >= 65) return Theme.colors.warning; + return Theme.colors.textMuted; } + tooltip: "CPU temp: " + sysStats.cpuTemp + "°C" + tooltipWindow: barWindow.trayTooltip + } - StatIndicator { - visible: sysStats.cpuTemp.length > 0 - glyph: "" // nf-fa-thermometer_half - text: sysStats.cpuTemp + "°" - tooltip: "CPU temp: " + sysStats.cpuTemp + "°C" - tooltipWindow: barWindow.trayTooltip - } + StatIndicator { + glyph: "" // nf-fa-server + text: sysStats.ramPercent + "%" + tint: Theme.colors.secondary + tooltip: "RAM usage: " + sysStats.ramPercent + "%" + tooltipWindow: barWindow.trayTooltip + } - StatIndicator { - glyph: "" // nf-fa-server - text: sysStats.ramPercent + "%" - tooltip: "RAM usage: " + sysStats.ramPercent + "%" - tooltipWindow: barWindow.trayTooltip - } + TrayIcon { + glyph: "" // nf-fa-wifi + active: wifiPoll.connected + tint: Theme.colors.primary + tooltip: "WiFi: " + wifiPoll.ssid + visible: wifiPoll.connected + tooltipWindow: barWindow.trayTooltip + } - TrayIcon { - glyph: "" // nf-fa-wifi - active: wifiPoll.connected - tooltip: "WiFi: " + wifiPoll.ssid - visible: wifiPoll.connected - tooltipWindow: barWindow.trayTooltip - } + TrayIcon { + glyph: "" // nf-fa-bluetooth_b + active: true + tint: Theme.colors.secondary + tooltip: "Bluetooth: " + bluetoothPoll.connectedDevices + visible: bluetoothPoll.connectedDevices.length > 0 + tooltipWindow: barWindow.trayTooltip + } - TrayIcon { - glyph: "" // nf-fa-bluetooth_b - active: true - tooltip: "Bluetooth: " + bluetoothPoll.connectedDevices - visible: bluetoothPoll.connectedDevices.length > 0 - tooltipWindow: barWindow.trayTooltip + TrayIcon { + glyph: { + let p = battery.percentage; + if (!battery.isPresent) return ""; // nf-fa-plug (desktop/no battery) + if (p >= 0.9) return ""; // nf-fa-battery_full + if (p >= 0.65) return ""; // nf-fa-battery_three_quarters + if (p >= 0.4) return ""; // nf-fa-battery_half + if (p >= 0.15) return ""; // nf-fa-battery_quarter + return ""; // nf-fa-battery_empty } - - TrayIcon { - glyph: { - let p = battery.percentage; - if (!battery.isPresent) return ""; // nf-fa-plug (desktop/no battery) - if (p >= 0.9) return ""; - if (p >= 0.65) return ""; - if (p >= 0.4) return ""; - if (p >= 0.15) return ""; - return ""; - } - active: battery.state === UPowerDeviceState.Charging - tooltip: battery.isPresent - ? "Battery: " + Math.round(battery.percentage * 100) + "%" - + (battery.state === UPowerDeviceState.Charging ? " (charging)" : "") - : "No battery" - visible: battery.isPresent - tooltipWindow: barWindow.trayTooltip + active: battery.state === UPowerDeviceState.Charging + tint: { + let p = battery.percentage; + if (p >= 0.5) return Theme.colors.success; + if (p >= 0.2) return Theme.colors.warning; + return Theme.colors.alert; } + tooltip: battery.isPresent + ? "Battery: " + Math.round(battery.percentage * 100) + "%" + + (battery.state === UPowerDeviceState.Charging ? " (charging)" : "") + : "No battery" + visible: battery.isPresent + tooltipWindow: barWindow.trayTooltip } } @@ -342,10 +338,13 @@ PanelWindow { } // Inline component for a compact icon+text stat readout (CPU, temp, RAM). + // `tint` colors both the glyph and text, so each stat reads as its own + // signal instead of everything sharing one flat color. component StatIndicator: Item { id: statIndicator property string glyph: "" property alias text: statText.text + property color tint: Theme.colors.text property string tooltip: "" property QtObject tooltipWindow @@ -361,16 +360,20 @@ PanelWindow { anchors.verticalCenter: parent.verticalCenter text: statIndicator.glyph font.family: Theme.font.family - font.pixelSize: 13 - color: Theme.colors.text + font.pixelSize: Theme.type.body + color: statIndicator.tint + + Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } } } Text { id: statText anchors.verticalCenter: parent.verticalCenter - color: Theme.colors.text + color: statIndicator.tint font.family: Theme.font.family - font.pixelSize: 12 + font.pixelSize: Theme.type.caption + + Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } } } } @@ -391,12 +394,14 @@ PanelWindow { // Inline component for a hoverable tray icon. The tooltip itself is // rendered by the shared TrayTooltip overlay window (see tooltipWindow) - // so it isn't clipped by this bar's small surface. + // so it isn't clipped by this bar's small surface. `tint` is this icon's + // own identity color (wifi vs bluetooth vs battery-by-level, etc.). component TrayIcon: Item { id: trayIcon property string glyph: "" property string tooltip: "" property bool active: false + property color tint: Theme.colors.primary property QtObject tooltipWindow width: 24 @@ -407,14 +412,18 @@ PanelWindow { radius: Theme.geometry.radiusTiny color: hoverArea.containsMouse ? Theme.colors.surfaceHover - : (trayIcon.active ? Qt.alpha(Theme.colors.primary, 0.15) : "transparent") + : (trayIcon.active ? Qt.alpha(trayIcon.tint, 0.15) : "transparent") + + Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } } Text { anchors.centerIn: parent text: trayIcon.glyph font.family: Theme.font.family - font.pixelSize: 13 - color: trayIcon.active ? Theme.colors.primary : Theme.colors.text + font.pixelSize: Theme.type.body + color: trayIcon.active ? trayIcon.tint : Theme.colors.text + + Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } } } } diff --git a/mutable_config/quickshell/components/Bar/TrayTooltip.qml b/mutable_config/quickshell/components/Bar/TrayTooltip.qml index 203f058..245ca15 100644 --- a/mutable_config/quickshell/components/Bar/TrayTooltip.qml +++ b/mutable_config/quickshell/components/Bar/TrayTooltip.qml @@ -40,7 +40,7 @@ PanelWindow { // Never accept input; this window only ever draws a small label. mask: Region {} - Rectangle { + Tooltip { // anchorX is the icon's horizontal center; center this bubble on it, // clamped so it never runs past the screen edges. x: Math.max( @@ -48,20 +48,6 @@ PanelWindow { Math.min(tooltipWindow.anchorX - width / 2, tooltipWindow.width - width - Theme.geometry.spacing) ) y: tooltipWindow.anchorY - 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: tooltipWindow.shownText - color: Theme.colors.text - font.family: Theme.font.family - font.pixelSize: 11 - } + text: tooltipWindow.shownText } } diff --git a/mutable_config/quickshell/components/ClipboardManager/ClipboardManager.qml b/mutable_config/quickshell/components/ClipboardManager/ClipboardManager.qml index 5c1cb09..1ec2361 100644 --- a/mutable_config/quickshell/components/ClipboardManager/ClipboardManager.qml +++ b/mutable_config/quickshell/components/ClipboardManager/ClipboardManager.qml @@ -1,5 +1,4 @@ import QtQuick -import QtQuick.Effects import Quickshell import Quickshell.Wayland import Quickshell.Io @@ -9,6 +8,10 @@ PanelWindow { id: clipboardWindow property QtObject rootState + readonly property int headerHeight: 50 + readonly property int footerHeight: 24 + readonly property int emptyStateHeight: 40 + visible: rootState.clipboardManagerOpen anchors { @@ -17,7 +20,7 @@ PanelWindow { left: true right: true } - + exclusiveZone: 0 color: "transparent" @@ -31,17 +34,19 @@ PanelWindow { onClicked: rootState.clipboardManagerOpen = false } - Rectangle { + Surface { id: container width: 800 - height: Math.min(600, (clipList.count > 0 ? clipList.contentHeight : 0) + (searchInput.text.length > 0 ? 50 + Theme.geometry.spacing : 0) + Theme.geometry.padding * 2) + height: Math.min(600, + headerHeight + Theme.geometry.spacing + + (clipModel.count > 0 ? clipList.contentHeight : emptyStateHeight) + Theme.geometry.spacing + + footerHeight + + Theme.geometry.padding * 2) anchors.centerIn: parent - radius: Theme.geometry.radiusMedium - color: Theme.colors.background - border.color: Theme.colors.border - border.width: 1 + tint: Theme.colors.secondary + glow: true - Behavior on scale { SpringAnimation { spring: 3; damping: 0.2 } } + Behavior on scale { SpringAnimation { spring: Theme.motion.springSoft.spring; damping: Theme.motion.springSoft.damping } } Behavior on opacity { NumberAnimation { duration: Theme.animation.durationFast } } Behavior on height { NumberAnimation { duration: Theme.animation.durationFast; easing.type: Easing.OutCubic } } @@ -50,161 +55,153 @@ PanelWindow { MouseArea { anchors.fill: parent } - + Column { anchors.fill: parent anchors.margins: Theme.geometry.padding - spacing: searchInput.text.length > 0 ? Theme.geometry.spacing : 0 + spacing: Theme.geometry.spacing - Rectangle { + TextField { + id: searchInput width: parent.width - height: searchInput.text.length > 0 ? 50 : 0 - opacity: searchInput.text.length > 0 ? 1 : 0 - clip: true - color: Theme.colors.surface - radius: Theme.geometry.radiusSmall - border.width: 1 - border.color: searchInput.activeFocus ? Theme.colors.primary : Theme.colors.border + height: clipboardWindow.headerHeight + placeholder: "Search clipboard..." - Behavior on height { NumberAnimation { duration: Theme.animation.durationFast } } - Behavior on opacity { NumberAnimation { duration: Theme.animation.durationFast } } - Behavior on border.color { ColorAnimation { duration: Theme.animation.durationFast } } - - layer.enabled: searchInput.activeFocus - layer.effect: MultiEffect { - shadowEnabled: true - shadowColor: Theme.colors.primary - shadowOpacity: 0.35 - shadowBlur: 0.4 - shadowHorizontalOffset: 0 - shadowVerticalOffset: 0 + onVisibleChanged: { + if (visible) focusInput(); } - TextInput { - id: searchInput - 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: "Search clipboard..." - color: Theme.colors.textMuted - font.family: Theme.font.family - font.pixelSize: 18 - anchors.verticalCenter: parent.verticalCenter - visible: searchInput.text.length === 0 - } - - onVisibleChanged: { - if (visible) forceActiveFocus(); - } + onTextChanged: { + loadProcess.restart(); + } - onTextChanged: { - loadProcess.restart(); - } + onEscapePressed: { + rootState.clipboardManagerOpen = false; + } - Keys.onEscapePressed: (event) => { - rootState.clipboardManagerOpen = false; - event.accepted = true; - } - - Keys.onUpPressed: (event) => { - if (clipList.currentIndex > 0) { - clipList.currentIndex--; - clipList.positionViewAtIndex(clipList.currentIndex, ListView.Contain); - } - event.accepted = true; - } - - Keys.onDownPressed: (event) => { - if (clipList.currentIndex < clipList.count - 1) { - clipList.currentIndex++; - clipList.positionViewAtIndex(clipList.currentIndex, ListView.Contain); - } - event.accepted = true; - } - - Keys.onReturnPressed: (event) => { - if (clipList.currentIndex >= 0 && clipList.currentIndex < clipModel.count) { - let item = clipModel.get(clipList.currentIndex); - copyToClipboard(item.id); - } - event.accepted = true; - } - - Keys.onPressed: (event) => { - if (event.key === Qt.Key_Delete || (event.key === Qt.Key_Backspace && searchInput.text.length === 0)) { - if (clipList.currentIndex >= 0 && clipList.currentIndex < clipModel.count) { - let item = clipModel.get(clipList.currentIndex); - deleteFromClipboard(item.id, item.rawLine, clipList.currentIndex); - } - event.accepted = true; - } + onUpPressed: { + if (clipList.currentIndex > 0) { + clipList.currentIndex--; + clipList.positionViewAtIndex(clipList.currentIndex, ListView.Contain); } } + + onDownPressed: { + if (clipList.currentIndex < clipList.count - 1) { + clipList.currentIndex++; + clipList.positionViewAtIndex(clipList.currentIndex, ListView.Contain); + } + } + + onReturnPressed: { + if (clipList.currentIndex >= 0 && clipList.currentIndex < clipModel.count) { + let item = clipModel.get(clipList.currentIndex); + copyToClipboard(item.id); + } + } + + onDeleteRequested: { + if (clipList.currentIndex >= 0 && clipList.currentIndex < clipModel.count) { + let item = clipModel.get(clipList.currentIndex); + deleteFromClipboard(item.id, item.rawLine, clipList.currentIndex); + } + } + } + + Text { + width: parent.width + height: clipboardWindow.emptyStateHeight + visible: clipModel.count === 0 + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + text: searchInput.text.length > 0 ? "No clipboard entries match “" + searchInput.text + "”" : "Clipboard is empty" + color: Theme.colors.textMuted + font.family: Theme.font.family + font.pixelSize: Theme.type.body } ListView { id: clipList width: parent.width - height: parent.height - (searchInput.text.length > 0 ? 50 + Theme.geometry.spacing : 0) + height: parent.height - clipboardWindow.headerHeight - clipboardWindow.footerHeight - Theme.geometry.spacing * 2 + visible: clipModel.count > 0 clip: true - spacing: Theme.geometry.spacing - - model: ListModel { id: clipModel } - - delegate: Rectangle { - width: clipList.width - height: 36 - color: ListView.isCurrentItem ? Theme.colors.surfaceHover : "transparent" - radius: Theme.geometry.radiusTiny + spacing: Theme.geometry.spacing / 2 - Item { - anchors.fill: parent - anchors.leftMargin: Theme.geometry.padding - anchors.rightMargin: Theme.geometry.padding - - Text { - text: model.content - color: Theme.colors.text - font.family: Theme.font.family - font.pixelSize: 14 - anchors.fill: parent - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight + model: ListModel { id: clipModel } + + delegate: ListRow { + id: clipRow + width: clipList.width + selected: ListView.isCurrentItem + accent: Theme.colors.secondary + + onEntered: clipList.currentIndex = index + onClicked: (mouse) => { + clipList.currentIndex = index; + if (mouse.button === Qt.RightButton) { + let pos = mapToItem(backdrop, mouse.x, mouse.y); + let itemId = model.id; + let rawLine = model.rawLine; + let itemIndex = index; + contextMenu.model = [ + { label: "Copy", icon: "", action: function() { copyToClipboard(itemId); } }, + { separator: true }, + { label: "Delete", icon: "", destructive: true, action: function() { deleteFromClipboard(itemId, rawLine, itemIndex); } } + ]; + contextMenu.openAt(pos.x, pos.y); + } else { + copyToClipboard(model.id); } } - - MouseArea { - id: clipItemMouse - anchors.fill: parent - hoverEnabled: true - acceptedButtons: Qt.LeftButton | Qt.RightButton - onEntered: clipList.currentIndex = index - onClicked: (mouse) => { - clipList.currentIndex = index; - if (mouse.button === Qt.RightButton) { - let pos = clipItemMouse.mapToItem(backdrop, mouse.x, mouse.y); - let itemId = model.id; - let rawLine = model.rawLine; - let itemIndex = index; - contextMenu.model = [ - { label: "Copy", icon: "⧉", action: function() { copyToClipboard(itemId); } }, - { separator: true }, - { label: "Delete", icon: "🗑", destructive: true, action: function() { deleteFromClipboard(itemId, rawLine, itemIndex); } } - ]; - contextMenu.openAt(pos.x, pos.y); - } else { - copyToClipboard(model.id); - } + + Text { + text: model.content + color: Theme.colors.text + font.family: Theme.font.family + font.pixelSize: Theme.type.label + anchors.left: parent.left + anchors.right: deleteButton.left + anchors.rightMargin: Theme.geometry.spacing + anchors.verticalCenter: parent.verticalCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + } + + Text { + id: deleteButton + text: "" + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + font.family: Theme.font.family + font.pixelSize: Theme.type.body + color: deleteMouse.containsMouse ? Theme.colors.alert : Theme.colors.textMuted + opacity: clipRow.hovered ? 1 : 0 + + Behavior on opacity { NumberAnimation { duration: Theme.animation.durationFast } } + Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } } + + MouseArea { + id: deleteMouse + anchors.fill: parent + anchors.margins: -6 + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: deleteFromClipboard(model.id, model.rawLine, index) } } } } + + HintBar { + width: parent.width + height: clipboardWindow.footerHeight + hints: [ + { key: "↵", label: "Copy" }, + { key: "Del", label: "Delete" }, + { key: "Esc", label: "Close" } + ] + } } } @@ -222,8 +219,8 @@ PanelWindow { Process { id: loadProcess command: [ - "bash", "-c", - "cliphist list | ( [ -z \"$1\" ] && cat || rg -i \"$1\" ) | head -n 50", + "bash", "-c", + "cliphist list | ( [ -z \"$1\" ] && cat || rg -i \"$1\" ) | head -n 50", "_", searchInput.text ] running: false @@ -237,7 +234,7 @@ PanelWindow { if (firstTab !== -1) { let id = lines[i].substring(0, firstTab); // Clean up newlines for multiline strings natively copied - let content = lines[i].substring(firstTab + 1).replace(/\n/g, ' ').replace(/\\n/g, ' '); + let content = lines[i].substring(firstTab + 1).replace(/\n/g, ' ').replace(/\\n/g, ' '); clipModel.append({ "id": id, "content": content, "rawLine": lines[i] }); } } diff --git a/mutable_config/quickshell/components/CommandPalette/CommandPalette.qml b/mutable_config/quickshell/components/CommandPalette/CommandPalette.qml index 0e16a33..209374a 100644 --- a/mutable_config/quickshell/components/CommandPalette/CommandPalette.qml +++ b/mutable_config/quickshell/components/CommandPalette/CommandPalette.qml @@ -1,5 +1,4 @@ import QtQuick -import QtQuick.Effects import Quickshell import Quickshell.Wayland import Quickshell.Services.Pipewire @@ -12,18 +11,56 @@ PanelWindow { property bool enterQueued: false property var usageCounts: ({}) property string lastUsedApp: "" + property var allApps: [] + property bool appsLoaded: false + + function scoreOf(desktopName) { + let count = paletteWindow.usageCounts[desktopName] || 0; + let isLast = (desktopName === paletteWindow.lastUsedApp); + return count * 10 + (isLast ? 10000 : 0); + } + + function applyFilter() { + let query = searchInput.text.trim().toLowerCase(); + let results = query.length === 0 + ? paletteWindow.allApps.slice() + : paletteWindow.allApps.filter(a => a.appName.toLowerCase().includes(query)); + + results.sort((a, b) => { + if (b.score !== a.score) return b.score - a.score; + return a.appName.localeCompare(b.appName); + }); + + results = results.slice(0, 50); + + appModel.clear(); + for (let i = 0; i < results.length; i++) { + appModel.append(results[i]); + } + + appList.currentIndex = appModel.count > 0 ? 0 : -1; + + if (paletteWindow.enterQueued && appModel.count > 0) { + paletteWindow.enterQueued = false; + paletteWindow.launchApp(0); + } + } + + readonly property int headerHeight: 50 + readonly property int footerHeight: 24 + readonly property int emptyStateHeight: 40 function launchApp(index) { if (index < 0 || index >= appModel.count) return; let item = appModel.get(index); let desktopName = item.desktopName; let appPath = item.appPath; - + logHistoryProcess.command = ["bash", "-c", "echo '" + desktopName + "' >> ~/.cache/quickshell-app-history.txt"]; logHistoryProcess.restart(); - + launchProcess.command = [ - "bash", "-c", + "bash", "-c", "EXEC=$(awk -F= '/^Exec=/ {print $2; exit}' \"$1\" | sed 's/ %[a-zA-Z]//g'); if command -v uwsm &>/dev/null; then eval \"uwsm app -- $EXEC\"; elif command -v niri &>/dev/null; then eval \"niri msg action spawn -- $EXEC\"; else nohup eval \"$EXEC\" /dev/null 2>&1 & fi", "_", appPath ]; @@ -39,7 +76,7 @@ PanelWindow { left: true right: true } - + exclusiveZone: 0 color: "transparent" @@ -49,24 +86,23 @@ PanelWindow { MouseArea { anchors.fill: parent - onClicked: { - rootState.commandPaletteOpen = false - rootState.commandPaletteOsdMode = false - } + onClicked: rootState.commandPaletteOpen = false } - Rectangle { + Surface { id: container // Sized appropriately for a 2560x1440 screen width: 800 - height: Math.min(600, (appList.count > 0 ? appList.contentHeight : 0) + (searchInput.text.length > 0 ? 50 + Theme.geometry.spacing : 0) + Theme.geometry.padding * 2) + height: Math.min(600, + headerHeight + Theme.geometry.spacing + + (appModel.count > 0 ? appList.contentHeight : emptyStateHeight) + Theme.geometry.spacing + + footerHeight + + Theme.geometry.padding * 2) anchors.centerIn: parent - radius: Theme.geometry.radiusMedium - color: Theme.colors.background - border.color: Theme.colors.border - border.width: 1 + tint: Theme.colors.primary + glow: true - Behavior on scale { SpringAnimation { spring: 3; damping: 0.2 } } + Behavior on scale { SpringAnimation { spring: Theme.motion.springSoft.spring; damping: Theme.motion.springSoft.damping } } Behavior on opacity { NumberAnimation { duration: Theme.animation.durationFast } } Behavior on height { NumberAnimation { duration: Theme.animation.durationFast; easing.type: Easing.OutCubic } } @@ -75,100 +111,54 @@ PanelWindow { MouseArea { anchors.fill: parent } - + // --- App Launcher --- Column { anchors.fill: parent anchors.margins: Theme.geometry.padding - spacing: searchInput.text.length > 0 ? Theme.geometry.spacing : 0 - - Rectangle { + spacing: Theme.geometry.spacing + + TextField { + id: searchInput width: parent.width - height: searchInput.text.length > 0 ? 50 : 0 - opacity: searchInput.text.length > 0 ? 1 : 0 - clip: true - color: Theme.colors.surface - radius: Theme.geometry.radiusSmall - border.width: 1 - border.color: searchInput.activeFocus ? Theme.colors.primary : Theme.colors.border + height: paletteWindow.headerHeight + placeholder: "Search apps..." - Behavior on height { NumberAnimation { duration: Theme.animation.durationFast } } - Behavior on opacity { NumberAnimation { duration: Theme.animation.durationFast } } - Behavior on border.color { ColorAnimation { duration: Theme.animation.durationFast } } - - layer.enabled: searchInput.activeFocus - layer.effect: MultiEffect { - shadowEnabled: true - shadowColor: Theme.colors.primary - shadowOpacity: 0.35 - shadowBlur: 0.4 - shadowHorizontalOffset: 0 - shadowVerticalOffset: 0 + onVisibleChanged: { + if (visible) focusInput(); } - TextInput { - id: searchInput - 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: "Search apps..." - color: Theme.colors.textMuted - font.family: Theme.font.family - font.pixelSize: 18 - anchors.verticalCenter: parent.verticalCenter - visible: searchInput.text.length === 0 - } - - onVisibleChanged: { - if (visible) forceActiveFocus(); - } - - onTextChanged: { - searchTimer.restart(); - } - - Keys.onEscapePressed: (event) => { - rootState.commandPaletteOpen = false; - event.accepted = true; - } - - Keys.onUpPressed: (event) => { - if (appList.currentIndex > 0) { - appList.currentIndex--; - appList.positionViewAtIndex(appList.currentIndex, ListView.Contain); - } - event.accepted = true; - } - - Keys.onDownPressed: (event) => { - if (appList.currentIndex < appList.count - 1) { - appList.currentIndex++; - appList.positionViewAtIndex(appList.currentIndex, ListView.Contain); - } - event.accepted = true; - } - - Keys.onReturnPressed: (event) => { - if (appList.count > 0 && appList.currentIndex >= 0 && appList.currentIndex < appModel.count) { - paletteWindow.launchApp(appList.currentIndex); - } else { - paletteWindow.enterQueued = true; - } - event.accepted = true; + onTextChanged: { + if (paletteWindow.appsLoaded) { + paletteWindow.applyFilter(); } } - } - Timer { - id: searchTimer - interval: 200 - onTriggered: searchProcess.restart() + onEscapePressed: { + rootState.commandPaletteOpen = false; + } + + onUpPressed: { + if (appList.currentIndex > 0) { + appList.currentIndex--; + appList.positionViewAtIndex(appList.currentIndex, ListView.Contain); + } + } + + onDownPressed: { + if (appList.currentIndex < appList.count - 1) { + appList.currentIndex++; + appList.positionViewAtIndex(appList.currentIndex, ListView.Contain); + } + } + + onReturnPressed: { + if (appList.count > 0 && appList.currentIndex >= 0 && appList.currentIndex < appModel.count) { + paletteWindow.launchApp(appList.currentIndex); + } else { + paletteWindow.enterQueued = true; + } + } } Process { @@ -191,21 +181,22 @@ PanelWindow { } paletteWindow.usageCounts = counts; paletteWindow.lastUsedApp = lastUsed; - - // Now that history is loaded, run the search - searchProcess.restart(); + + // Now that history is loaded, list every desktop entry once. + // Filtering as the user types happens entirely in JS below + // (applyFilter), so the expensive disk/symlink walk here + // only ever runs a single time per palette open. + listProcess.restart(); } } } Process { - id: searchProcess + id: listProcess command: [ - "bash", - "-c", - "fd -L -t f -e desktop -0 . /usr/share/applications ~/.local/share/applications /var/lib/flatpak/exports/share/applications /run/current-system/sw/share/applications ~/.nix-profile/share/applications 2>/dev/null | xargs -0 -r awk -F= 'BEGIN { OFS=\"|\" } FNR==1 { if(file!=\"\" && name!=\"\") print icon, name, file; name=\"\"; icon=\"\"; file=FILENAME } /^Name=/ && name==\"\" { name=substr($0, 6) } /^Icon=/ && icon==\"\" { icon=substr($0, 6) } END { if(file!=\"\" && name!=\"\") print icon, name, file }' | { [ -z \"$1\" ] && cat || rg -i \"$1\"; } | head -n 20", - "_", - searchInput.text + "bash", + "-c", + "fd -L -t f -e desktop -0 . /usr/share/applications ~/.local/share/applications /var/lib/flatpak/exports/share/applications /run/current-system/sw/share/applications ~/.nix-profile/share/applications 2>/dev/null | xargs -0 -r awk -F= 'BEGIN { OFS=\"|\" } FNR==1 { if(file!=\"\" && name!=\"\") print icon, name, file; name=\"\"; icon=\"\"; file=FILENAME } /^Name=/ && name==\"\" { name=substr($0, 6) } /^Icon=/ && icon==\"\" { icon=substr($0, 6) } END { if(file!=\"\" && name!=\"\") print icon, name, file }'" ] running: false function restart() { @@ -215,117 +206,113 @@ PanelWindow { stdout: StdioCollector { onStreamFinished: { let lines = this.text.split('\n').filter(l => l.trim() !== ""); - let results = []; - + let apps = []; + for (let i = 0; i < lines.length; i++) { let parts = lines[i].split('|'); if (parts.length >= 3) { let desktopName = parts[2].split('/').pop(); - - // Calculate frecency score - let count = paletteWindow.usageCounts[desktopName] || 0; let isLast = (desktopName === paletteWindow.lastUsedApp); - // Give a massive boost to the absolute last used app, then weight by total usage - let score = count * 10 + (isLast ? 10000 : 0); - - results.push({ - "iconName": parts[0], - "appName": parts[1], + + apps.push({ + "iconName": parts[0], + "appName": parts[1], "appPath": parts[2], "desktopName": desktopName, - "score": score + "isLastUsed": isLast, + "score": paletteWindow.scoreOf(desktopName) }); } } - - // Sort by score (descending), then alphabetically - results.sort((a, b) => { - if (b.score !== a.score) return b.score - a.score; - return a.appName.localeCompare(b.appName); - }); - - appModel.clear(); - for (let i = 0; i < results.length; i++) { - appModel.append(results[i]); - } - - appList.currentIndex = 0; - - if (paletteWindow.enterQueued && appModel.count > 0) { - paletteWindow.enterQueued = false; - paletteWindow.launchApp(0); - } + + paletteWindow.allApps = apps; + paletteWindow.appsLoaded = true; + paletteWindow.applyFilter(); } } } - + + Text { + width: parent.width + height: paletteWindow.emptyStateHeight + visible: appModel.count === 0 + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + text: searchInput.text.length > 0 ? "No apps found for “" + searchInput.text + "”" : "No apps found" + color: Theme.colors.textMuted + font.family: Theme.font.family + font.pixelSize: Theme.type.body + } + ListView { id: appList width: parent.width - height: parent.height - (searchInput.text.length > 0 ? 50 + Theme.geometry.spacing : 0) + height: parent.height - paletteWindow.headerHeight - paletteWindow.footerHeight - Theme.geometry.spacing * 2 + visible: appModel.count > 0 clip: true - spacing: Theme.geometry.spacing - - model: ListModel { id: appModel } - - delegate: Rectangle { - width: appList.width - height: 36 - color: ListView.isCurrentItem ? Theme.colors.surfaceHover : "transparent" - radius: Theme.geometry.radiusTiny + spacing: Theme.geometry.spacing / 2 - Item { - anchors.fill: parent - anchors.leftMargin: Theme.geometry.padding - anchors.rightMargin: Theme.geometry.padding - - Image { - id: appIcon - width: 24 - height: 24 - source: model.iconName ? Quickshell.iconPath(model.iconName) : "" - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - fillMode: Image.PreserveAspectFit - - Rectangle { - anchors.fill: parent - color: Theme.colors.primary - radius: 12 - visible: parent.status === Image.Error || parent.status === Image.Null || model.iconName === "" - - Text { - anchors.centerIn: parent - text: model.appName.charAt(0).toUpperCase() - color: Theme.colors.background - font.bold: true - font.pixelSize: 12 - } + model: ListModel { id: appModel } + + delegate: ListRow { + width: appList.width + selected: ListView.isCurrentItem + accent: model.isLastUsed ? Theme.colors.secondary : Theme.colors.primary + + onEntered: appList.currentIndex = index + onClicked: { + appList.currentIndex = index; + paletteWindow.launchApp(index); + } + + Image { + id: appIcon + width: 24 + height: 24 + source: model.iconName ? Quickshell.iconPath(model.iconName) : "" + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + fillMode: Image.PreserveAspectFit + + Rectangle { + anchors.fill: parent + color: Theme.colors.primary + radius: 12 + visible: parent.status === Image.Error || parent.status === Image.Null || model.iconName === "" + + Text { + anchors.centerIn: parent + text: model.appName.charAt(0).toUpperCase() + color: Theme.colors.textOnAccent + font.bold: true + font.pixelSize: 12 } } - - Text { - text: model.appName - color: Theme.colors.text - font.family: Theme.font.family - font.pixelSize: 14 - anchors.left: appIcon.right - anchors.leftMargin: Theme.geometry.spacing - anchors.verticalCenter: parent.verticalCenter - } } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - onEntered: appList.currentIndex = index - onClicked: { - appList.currentIndex = index; - paletteWindow.launchApp(index); - } + + Text { + text: model.appName + color: Theme.colors.text + font.family: Theme.font.family + font.pixelSize: Theme.type.label + anchors.left: appIcon.right + anchors.leftMargin: Theme.geometry.spacing + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight } } } + + HintBar { + width: parent.width + height: paletteWindow.footerHeight + hints: [ + { key: "↑↓", label: "Navigate" }, + { key: "↵", label: "Launch" }, + { key: "Esc", label: "Close" } + ] + } } Process { @@ -336,7 +323,7 @@ PanelWindow { running = true; } } - + Process { id: logHistoryProcess running: false @@ -352,9 +339,10 @@ PanelWindow { container.scale = 1.0; searchInput.text = ""; paletteWindow.enterQueued = false; + paletteWindow.appsLoaded = false; appModel.clear(); // Clear so it re-populates clean - - // Read history first, then search + + // Read history first, then list every desktop entry once historyProcess.restart(); } else { container.scale = 0.95; diff --git a/mutable_config/quickshell/components/LogoutMenu/LogoutMenu.qml b/mutable_config/quickshell/components/LogoutMenu/LogoutMenu.qml index 297e563..a0bb531 100644 --- a/mutable_config/quickshell/components/LogoutMenu/LogoutMenu.qml +++ b/mutable_config/quickshell/components/LogoutMenu/LogoutMenu.qml @@ -55,7 +55,7 @@ PanelWindow { height: buttonRow.height anchors.centerIn: parent - Behavior on scale { SpringAnimation { spring: 3; damping: 0.2 } } + Behavior on scale { SpringAnimation { spring: Theme.motion.springSoft.spring; damping: Theme.motion.springSoft.damping } } Row { id: buttonRow @@ -63,7 +63,7 @@ PanelWindow { // Lock LogoutButton { - icon: "🔒" + icon: "" label: "Lock" isSelected: logoutWindow.currentIndex === 0 onClicked: executeAction(logoutWindow.actions[0].cmd) @@ -72,7 +72,7 @@ PanelWindow { // Suspend LogoutButton { - icon: "🌙" + icon: "" label: "Suspend" isSelected: logoutWindow.currentIndex === 1 onClicked: executeAction(logoutWindow.actions[1].cmd) @@ -81,7 +81,7 @@ PanelWindow { // Logout LogoutButton { - icon: "🚪" + icon: "" label: "Logout" isSelected: logoutWindow.currentIndex === 2 onClicked: executeAction(logoutWindow.actions[2].cmd) @@ -90,7 +90,7 @@ PanelWindow { // Reboot LogoutButton { - icon: "🔄" + icon: "" label: "Reboot" isSelected: logoutWindow.currentIndex === 3 onClicked: executeAction(logoutWindow.actions[3].cmd) @@ -99,7 +99,7 @@ PanelWindow { // Poweroff LogoutButton { - icon: "⏻" + icon: "" label: "Shutdown" isDestructive: true isSelected: logoutWindow.currentIndex === 4 @@ -161,7 +161,7 @@ PanelWindow { } // Inline component for the big buttons - component LogoutButton: Rectangle { + component LogoutButton: Surface { property string icon: "" property string label: "" property bool isDestructive: false @@ -171,12 +171,12 @@ PanelWindow { width: 120 height: 120 - radius: Theme.geometry.radiusMedium color: Theme.colors.surface - border.color: isSelected ? (isDestructive ? Theme.colors.alert : Theme.colors.primary) : Theme.colors.border + tint: isSelected ? (isDestructive ? Theme.colors.alert : Theme.colors.primary) : Theme.colors.border border.width: isSelected ? 2 : 1 - - Behavior on scale { SpringAnimation { spring: 4; damping: 0.3 } } + glow: isSelected + + Behavior on scale { SpringAnimation { spring: Theme.motion.springSnappy.spring; damping: Theme.motion.springSnappy.damping } } scale: isSelected ? 1.05 : 1.0 Column { @@ -185,9 +185,10 @@ PanelWindow { Text { text: parent.parent.icon + font.family: Theme.font.family font.pixelSize: 36 anchors.horizontalCenter: parent.horizontalCenter - color: Theme.colors.text + color: parent.parent.isSelected ? parent.parent.tint : Theme.colors.text } Text { diff --git a/mutable_config/quickshell/components/Notifications/Notifications.qml b/mutable_config/quickshell/components/Notifications/Notifications.qml index 0c4182a..f24cc70 100644 --- a/mutable_config/quickshell/components/Notifications/Notifications.qml +++ b/mutable_config/quickshell/components/Notifications/Notifications.qml @@ -84,7 +84,7 @@ PanelWindow { function colorFor(urgency) { if (urgency === NotificationUrgency.Critical) return Theme.colors.alert; if (urgency === NotificationUrgency.Low) return Theme.colors.success; - return Theme.colors.primary; + return Theme.colors.info; } function labelFor(urgency) { @@ -158,8 +158,9 @@ PanelWindow { Text { id: closeIcon - text: "✕" + text: "" color: Theme.colors.textMuted + font.family: Theme.font.family font.pixelSize: 12 anchors.top: parent.top diff --git a/mutable_config/quickshell/components/OSD/OSD.qml b/mutable_config/quickshell/components/OSD/OSD.qml index fc5c1c7..1e61da7 100644 --- a/mutable_config/quickshell/components/OSD/OSD.qml +++ b/mutable_config/quickshell/components/OSD/OSD.qml @@ -76,58 +76,50 @@ PanelWindow { } } - Rectangle { + Surface { width: 300 - height: parent.implicitHeight + height: 60 anchors.centerIn: parent - color: Theme.colors.background radius: Theme.geometry.pillRadius - border.color: Theme.colors.border - border.width: 1 - + tint: osdWindow.levelColor + glow: true + Item { anchors.fill: parent anchors.margins: Theme.geometry.padding - + Text { id: iconText anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter text: { if (mode === "volume") { - if (isMuted) return "🔇"; - if (volumeLevel < 0.33) return "🔈"; - if (volumeLevel < 0.66) return "🔉"; - return "🔊"; + if (isMuted) return ""; // nf-fa-volume_off + if (volumeLevel < 0.5) return ""; // nf-fa-volume_down + return ""; // nf-fa-volume_up } else { - return "☀️"; + return ""; // nf-fa-sun_o } } - color: Theme.colors.text + color: osdWindow.levelColor + font.family: Theme.font.family font.pixelSize: 18 } - - Rectangle { + + ProgressBar { anchors.left: iconText.right anchors.leftMargin: Theme.geometry.spacing anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - height: 8 - color: Theme.colors.surfaceHover - radius: 4 - clip: true - - Rectangle { - width: parent.width * (mode === "volume" ? volumeLevel : brightnessLevel) - height: parent.height - color: (mode === "volume" && isMuted) ? Theme.colors.textMuted : Theme.colors.primary - radius: 4 - - Behavior on width { - NumberAnimation { duration: Theme.animation.durationFast } - } - } + value: mode === "volume" ? volumeLevel : brightnessLevel + fillColor: osdWindow.levelColor } } } + + // Volume gets the primary accent, brightness gets a warm warning-ish + // tint (sun-colored), muted volume falls back to a neutral color. + readonly property color levelColor: (mode === "volume" && isMuted) + ? Theme.colors.textMuted + : (mode === "volume" ? Theme.colors.primary : Theme.colors.warning) } diff --git a/mutable_config/quickshell/components/Shared/Button.qml b/mutable_config/quickshell/components/Shared/Button.qml index 67310aa..a4f1f18 100644 --- a/mutable_config/quickshell/components/Shared/Button.qml +++ b/mutable_config/quickshell/components/Shared/Button.qml @@ -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 { diff --git a/mutable_config/quickshell/components/Shared/ContextMenu.qml b/mutable_config/quickshell/components/Shared/ContextMenu.qml index 706b8ea..9535c60 100644 --- a/mutable_config/quickshell/components/Shared/ContextMenu.qml +++ b/mutable_config/quickshell/components/Shared/ContextMenu.qml @@ -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 } } diff --git a/mutable_config/quickshell/components/Shared/HintBar.qml b/mutable_config/quickshell/components/Shared/HintBar.qml new file mode 100644 index 0000000..abe22b5 --- /dev/null +++ b/mutable_config/quickshell/components/Shared/HintBar.qml @@ -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 + } + } + } +} diff --git a/mutable_config/quickshell/components/Shared/ListRow.qml b/mutable_config/quickshell/components/Shared/ListRow.qml new file mode 100644 index 0000000..ef54631 --- /dev/null +++ b/mutable_config/quickshell/components/Shared/ListRow.qml @@ -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 + } +} diff --git a/mutable_config/quickshell/components/Shared/Pill.qml b/mutable_config/quickshell/components/Shared/Pill.qml new file mode 100644 index 0000000..62e0b65 --- /dev/null +++ b/mutable_config/quickshell/components/Shared/Pill.qml @@ -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 + } +} diff --git a/mutable_config/quickshell/components/Shared/ProgressBar.qml b/mutable_config/quickshell/components/Shared/ProgressBar.qml new file mode 100644 index 0000000..01e541d --- /dev/null +++ b/mutable_config/quickshell/components/Shared/ProgressBar.qml @@ -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 } } + } + } +} diff --git a/mutable_config/quickshell/components/Shared/Showcase.qml b/mutable_config/quickshell/components/Shared/Showcase.qml new file mode 100644 index 0000000..187cb1b --- /dev/null +++ b/mutable_config/quickshell/components/Shared/Showcase.qml @@ -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" } + } + } +} diff --git a/mutable_config/quickshell/components/Shared/Surface.qml b/mutable_config/quickshell/components/Shared/Surface.qml new file mode 100644 index 0000000..5f77cdd --- /dev/null +++ b/mutable_config/quickshell/components/Shared/Surface.qml @@ -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 + } +} diff --git a/mutable_config/quickshell/components/Shared/TextField.qml b/mutable_config/quickshell/components/Shared/TextField.qml new file mode 100644 index 0000000..e433174 --- /dev/null +++ b/mutable_config/quickshell/components/Shared/TextField.qml @@ -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; + } + } + } +} diff --git a/mutable_config/quickshell/components/Shared/Theme.qml b/mutable_config/quickshell/components/Shared/Theme.qml index f0f37e8..838f6e6 100644 --- a/mutable_config/quickshell/components/Shared/Theme.qml +++ b/mutable_config/quickshell/components/Shared/Theme.qml @@ -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" } diff --git a/mutable_config/quickshell/components/Shared/Tooltip.qml b/mutable_config/quickshell/components/Shared/Tooltip.qml new file mode 100644 index 0000000..f4bf5b0 --- /dev/null +++ b/mutable_config/quickshell/components/Shared/Tooltip.qml @@ -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 + } +} diff --git a/mutable_config/quickshell/components/Shared/qmldir b/mutable_config/quickshell/components/Shared/qmldir index ddcaaba..20295c2 100644 --- a/mutable_config/quickshell/components/Shared/qmldir +++ b/mutable_config/quickshell/components/Shared/qmldir @@ -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 diff --git a/mutable_config/quickshell/components/WallpaperPicker/WallpaperPicker.qml b/mutable_config/quickshell/components/WallpaperPicker/WallpaperPicker.qml index 4e6f1c0..d648a81 100644 --- a/mutable_config/quickshell/components/WallpaperPicker/WallpaperPicker.qml +++ b/mutable_config/quickshell/components/WallpaperPicker/WallpaperPicker.qml @@ -115,15 +115,15 @@ PanelWindow { width: isCurrent ? 260 : 170 height: 340 - Rectangle { + Surface { anchors.centerIn: parent width: isCurrent ? 240 : 150 height: isCurrent ? 320 : 200 - radius: Theme.geometry.radiusMedium color: Theme.colors.surface - border.color: delegateRoot.isCurrent ? Theme.colors.primary : Theme.colors.border + tint: delegateRoot.isCurrent ? Theme.colors.primary : Theme.colors.border border.width: delegateRoot.isCurrent ? 2 : 1 opacity: delegateRoot.isCurrent ? 1.0 : 0.5 + glow: delegateRoot.isCurrent clip: true Image { diff --git a/mutable_config/quickshell/shell.qml b/mutable_config/quickshell/shell.qml index 7e2253b..b58199b 100644 --- a/mutable_config/quickshell/shell.qml +++ b/mutable_config/quickshell/shell.qml @@ -122,4 +122,15 @@ ShellRoot { id: wallpaperPicker rootState: root } + + IpcHandler { + target: "showcase" + function toggle() { + showcase.open = !showcase.open; + } + } + + Showcase { + id: showcase + } }