From fc3b08f6cb70ed4aa90aa25a485472c876033b2a Mon Sep 17 00:00:00 2001 From: Bruno Inec Date: Wed, 27 Aug 2025 07:58:54 +0200 Subject: [PATCH] bar/clock: allow hiding icon (#484) * bar(clock): allow hiding the calendar icon * loader + showCalendarIcon -> showIcon --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> --- README.md | 3 +++ config/BarConfig.qml | 5 +++++ modules/bar/components/Clock.qml | 18 ++++++++++++------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d5d1f834..db0f9912 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,9 @@ default, you must create it manually. } }, "bar": { + "clock": { + "showIcon": true + }, "dragThreshold": 20, "entries": [ { diff --git a/config/BarConfig.qml b/config/BarConfig.qml index 1733e479..a4a87ecf 100644 --- a/config/BarConfig.qml +++ b/config/BarConfig.qml @@ -7,6 +7,7 @@ JsonObject { property Workspaces workspaces: Workspaces {} property Tray tray: Tray {} property Status status: Status {} + property Clock clock: Clock {} property Sizes sizes: Sizes {} property list entries: [ @@ -77,6 +78,10 @@ JsonObject { property bool showBattery: true } + component Clock: JsonObject { + property bool showIcon: true + } + component Sizes: JsonObject { property int innerWidth: 40 property int windowPreviewSize: 400 diff --git a/modules/bar/components/Clock.qml b/modules/bar/components/Clock.qml index 46f0e470..be29c0b4 100644 --- a/modules/bar/components/Clock.qml +++ b/modules/bar/components/Clock.qml @@ -1,3 +1,5 @@ +pragma ComponentBehavior: Bound + import qs.components import qs.services import qs.config @@ -10,13 +12,17 @@ Column { spacing: Appearance.spacing.small - MaterialIcon { - id: icon - - text: "calendar_month" - color: root.colour - + Loader { anchors.horizontalCenter: parent.horizontalCenter + + active: Config.bar.clock.showIcon + visible: active + asynchronous: true + + sourceComponent: MaterialIcon { + text: "calendar_month" + color: root.colour + } } StyledText {