feat: colorful multi-accent quickshell design system
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A8TNMgnEa7Kia5Wcz2kyDx
This commit is contained in:
1 parent
b8255db11a
commit
e818b1c1ea
23 files changed
+1073
-577
No files matched your search
@@ -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 } }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user