Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions AppWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "Model.js" as Model

Expand Down Expand Up @@ -41,13 +42,13 @@ PanelWindow {

// ---- Theme (follows the running Omarchy theme automatically) ----
readonly property string contentFontFamily: bar ? bar.fontFamily : Style.font.family
readonly property color fg: Color.foreground
readonly property color bg: Color.background
readonly property color accent: Color.accent
readonly property color urgent: Color.urgent
readonly property color muted: Color.muted
readonly property color surface: Color.popups.background
readonly property color surfaceBorder: Color.popups.border
readonly property color fg: Commons.Color.foreground
readonly property color bg: Commons.Color.background
readonly property color accent: Commons.Color.accent
readonly property color urgent: Commons.Color.urgent
readonly property color muted: Commons.Color.muted
readonly property color surface: Commons.Color.popups.background
readonly property color surfaceBorder: Commons.Color.popups.border
readonly property color dim1: Qt.darker(fg, 1.35)
readonly property color dim2: Qt.darker(fg, 1.7)
readonly property color accentSoft: Qt.rgba(accent.r, accent.g, accent.b, 0.14)
Expand Down Expand Up @@ -138,8 +139,8 @@ PanelWindow {

// Border specs for the app's card + tooltip surfaces, resolved once from the
// theme's [popups] / [tooltip] roles so they honor per-theme border styling.
readonly property var cardBorderSpec: Border.localOrSurfaceSpec("popups", "border", surfaceBorder, Color.popups.border, Math.max(1, Style.space(2)))
readonly property var tipBorderSpec: Border.localOrSurfaceSpec("tooltip", "border", Color.tooltip.border, Color.tooltip.border, Style.normalBorderWidth)
readonly property var cardBorderSpec: Border.localOrSurfaceSpec("popups", "border", surfaceBorder, Commons.Color.popups.border, Math.max(1, Style.space(2)))
readonly property var tipBorderSpec: Border.localOrSurfaceSpec("tooltip", "border", Commons.Color.tooltip.border, Commons.Color.tooltip.border, Style.normalBorderWidth)

// ---- Data (DB snapshot via sample-json.sh) ----
property var sample: ({ cpu: 0, mem: 0, gpu: 0, procs: 0, disk: 0, disk_r: 0, disk_w: 0,
Expand Down Expand Up @@ -1404,7 +1405,7 @@ PanelWindow {
Rectangle {
anchors.fill: parent
z: 0
color: Color.menu.scrim
color: Commons.Color.menu.scrim
TapHandler {
onTapped: root.open = false
}
Expand Down Expand Up @@ -3978,7 +3979,7 @@ PanelWindow {

Rectangle {
anchors.fill: parent
color: Color.menu.scrim
color: Commons.Color.menu.scrim
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
Expand Down Expand Up @@ -6123,7 +6124,7 @@ PanelWindow {
width: Style.space(250)
implicitHeight: tipCol.implicitHeight + Style.space(16)
radius: Style.cornerRadius
color: Color.tooltip.background
color: Commons.Color.tooltip.background
borderSpec: root.tipBorderSpec
property var tipRows: []
property int tipTotal: 0
Expand All @@ -6140,15 +6141,15 @@ PanelWindow {
id: tipTime
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
color: Qt.rgba(Color.tooltip.text.r, Color.tooltip.text.g, Color.tooltip.text.b, 0.75)
color: Qt.rgba(Commons.Color.tooltip.text.r, Commons.Color.tooltip.text.g, Commons.Color.tooltip.text.b, 0.75)
font.family: root.contentFontFamily
font.pixelSize: Style.font.caption
}
Text {
id: tipValue
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
color: Color.tooltip.text
color: Commons.Color.tooltip.text
font.family: root.contentFontFamily
font.pixelSize: Style.font.subtitle
font.bold: true
Expand Down Expand Up @@ -6187,7 +6188,7 @@ PanelWindow {
anchors.verticalCenter: parent.verticalCenter
textFormat: Text.PlainText
text: modelData.name
color: Color.tooltip.text
color: Commons.Color.tooltip.text
font.family: root.contentFontFamily
font.pixelSize: Style.font.caption
elide: Text.ElideRight
Expand All @@ -6197,7 +6198,7 @@ PanelWindow {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: modelData.pctText
color: Color.tooltip.text
color: Commons.Color.tooltip.text
font.family: root.contentFontFamily
font.pixelSize: Style.font.caption
font.bold: true
Expand All @@ -6211,7 +6212,7 @@ PanelWindow {
text: tip.tipTotal > tip.tipRows.length
? "Click the graph to see " + (tip.tipTotal - tip.tipRows.length) + " others"
: ""
color: Qt.rgba(Color.tooltip.text.r, Color.tooltip.text.g, Color.tooltip.text.b, 0.6)
color: Qt.rgba(Commons.Color.tooltip.text.r, Commons.Color.tooltip.text.g, Commons.Color.tooltip.text.b, 0.6)
font.family: root.contentFontFamily
font.pixelSize: Style.font.caption
elide: Text.ElideRight
Expand Down
11 changes: 6 additions & 5 deletions BarWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "Model.js" as Model

Expand All @@ -25,18 +26,18 @@ BarWidget {
// window agree and both track the theme. Mirrors AppWindow's tinted().
function tintedOk() {
var base = Qt.rgba(0x3f / 255, 0xb9 / 255, 0x50 / 255, 1)
var accent = Color.accent
var accent = Commons.Color.accent
var t = 0.22
return Qt.rgba(base.r + (accent.r - base.r) * t,
base.g + (accent.g - base.g) * t,
base.b + (accent.b - base.b) * t, 1)
}
readonly property color bellColor: {
switch (root.bellColorToken) {
case "danger": return root.bar && root.bar.urgent ? root.bar.urgent : Color.urgent
case "danger": return root.bar && root.bar.urgent ? root.bar.urgent : Commons.Color.urgent
case "green": return root.tintedOk()
case "accent": return Color.accent
default: return root.bar && root.bar.foreground ? root.bar.foreground : Color.foreground
case "accent": return Commons.Color.accent
default: return root.bar && root.bar.foreground ? root.bar.foreground : Commons.Color.foreground
}
}

Expand Down Expand Up @@ -424,7 +425,7 @@ BarWidget {
text: root.label
fontSize: Style.font.caption
active: root.alert || root.bellActive || root.stale
activeColor: (root.alert || root.stale) ? (root.bar && root.bar.urgent ? root.bar.urgent : Color.urgent) : root.bellColor
activeColor: (root.alert || root.stale) ? (root.bar && root.bar.urgent ? root.bar.urgent : Commons.Color.urgent) : root.bellColor
tooltipText: {
if (!root.ready) return "OmaControl — loading..."
var d = root.lastData || {}
Expand Down