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:
johannesandClaude Sonnet 5 committed 2026-08-29 16:16:32 +02:00
1 parent 5a004b8be5
commit 215d8b7d8e
23 files changed
+1073 -577

No files matched your search

+1 -1
View File
@@ -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
+124 -115
View File
@@ -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 } }
}
}
@@ -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
}
}
@@ -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] });
}
}
@@ -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 >/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;
@@ -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 {
@@ -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
@@ -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)
}
@@ -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
@@ -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 {
+11
View File
@@ -122,4 +122,15 @@ ShellRoot {
id: wallpaperPicker
rootState: root
}
IpcHandler {
target: "showcase"
function toggle() {
showcase.open = !showcase.open;
}
}
Showcase {
id: showcase
}
}