From 4684e8a24fa34c790d1d448cb00efa151bedb225 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 9 Jun 2026 16:04:03 +1000 Subject: [PATCH] feat: add workspace font config No Rubik hardcoding --- README.md | 1 + modules/bar/components/workspaces/Workspace.qml | 2 +- plugin/src/Caelestia/Config/appearanceconfig.hpp | 2 ++ plugin/src/Caelestia/Config/font.cpp | 6 ++++++ plugin/src/Caelestia/Config/font.hpp | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e72e690..59a8a752 100644 --- a/README.md +++ b/README.md @@ -279,6 +279,7 @@ For example, to disable the bar on DP-1: "font": { "scale": 1, "clock": "Rubik", + "workspaces": "Rubik", "headline": { "family": "GoogleSansFlex", "large": { "size": 32, "weight": 500, "italic": false, "vaxes": { "ROND": 25 } }, diff --git a/modules/bar/components/workspaces/Workspace.qml b/modules/bar/components/workspaces/Workspace.qml index 42ac844e..a7d0dada 100644 --- a/modules/bar/components/workspaces/Workspace.qml +++ b/modules/bar/components/workspaces/Workspace.qml @@ -52,7 +52,7 @@ ColumnLayout { } color: Config.bar.workspaces.occupiedBg || root.isOccupied || root.activeWsId === root.ws ? Colours.palette.m3onSurface : Colours.layer(Colours.palette.m3outlineVariant, 2) verticalAlignment: Qt.AlignVCenter - font.family: "Rubik" // Hard code rubik for now since google sans doesn't play well with certain unicode symbols apparently + font.family: Tokens.font.workspaces } Loader { diff --git a/plugin/src/Caelestia/Config/appearanceconfig.hpp b/plugin/src/Caelestia/Config/appearanceconfig.hpp index 17e18aa1..411f5503 100644 --- a/plugin/src/Caelestia/Config/appearanceconfig.hpp +++ b/plugin/src/Caelestia/Config/appearanceconfig.hpp @@ -188,6 +188,8 @@ class AppearanceFont : public ConfigObject { CONFIG_SUBOBJECT(FontStyleConfig, mono) CONFIG_SUBOBJECT(IconFontStyleConfig, icon) CONFIG_PROPERTY(QString, clock, QStringLiteral("Rubik")) + // Google Sans Flex doesn't play well with unicode symbols apparently, so use Rubik instead + CONFIG_PROPERTY(QString, workspaces, QStringLiteral("Rubik")) public: explicit AppearanceFont(QObject* parent = nullptr) diff --git a/plugin/src/Caelestia/Config/font.cpp b/plugin/src/Caelestia/Config/font.cpp index edd75069..8e2090bf 100644 --- a/plugin/src/Caelestia/Config/font.cpp +++ b/plugin/src/Caelestia/Config/font.cpp @@ -209,6 +209,10 @@ FontBuilder FontTokens::clock() const { return FontBuilder(m_clock); } +QString FontTokens::workspaces() const { + return m_font ? m_font->workspaces() : QString(); +} + void FontTokens::bindFont(AppearanceFont* font) { if (m_font == font) return; @@ -229,6 +233,7 @@ void FontTokens::bindFont(AppearanceFont* font) { connect(font, &AppearanceFont::clockChanged, this, &FontTokens::rebuildClock); connect(font, &AppearanceFont::scaleChanged, this, &FontTokens::rebuildScale); + connect(font, &AppearanceFont::workspacesChanged, this, &FontTokens::workspacesChanged); } else { rebuildScale(); m_headline->bind(nullptr); @@ -240,6 +245,7 @@ void FontTokens::bindFont(AppearanceFont* font) { } rebuildClock(); + emit workspacesChanged(); } void FontTokens::rebuildScale() { diff --git a/plugin/src/Caelestia/Config/font.hpp b/plugin/src/Caelestia/Config/font.hpp index 2cfbf341..093bc40e 100644 --- a/plugin/src/Caelestia/Config/font.hpp +++ b/plugin/src/Caelestia/Config/font.hpp @@ -131,6 +131,7 @@ class FontTokens : public QObject { Q_PROPERTY(caelestia::config::FontStyle* mono READ mono CONSTANT FINAL) Q_PROPERTY(caelestia::config::IconFontStyle* icon READ icon CONSTANT FINAL) Q_PROPERTY(caelestia::config::FontBuilder clock READ clock NOTIFY clockChanged FINAL) + Q_PROPERTY(QString workspaces READ workspaces NOTIFY workspacesChanged FINAL) public: explicit FontTokens(QObject* parent = nullptr); @@ -144,9 +145,11 @@ public: [[nodiscard]] FontStyle* mono() const; [[nodiscard]] IconFontStyle* icon() const; [[nodiscard]] FontBuilder clock() const; + [[nodiscard]] QString workspaces() const; signals: void clockChanged(); + void workspacesChanged(); private: void rebuildClock();