diff --git a/bar/modules/Stats.qml b/bar/modules/Stats.qml index f6b7265..e97559d 100644 --- a/bar/modules/Stats.qml +++ b/bar/modules/Stats.qml @@ -136,15 +136,51 @@ Rectangle { HoverHandler { id: hov } + + property bool showAlt: false + onShowAltChanged: arc.requestPaint() + + Connections { + target: hov + function onHoveredChanged() { + if (!hov.hovered) ring.showAlt = false + } + } + + TapHandler { + enabled: !Cfg.Config.statsHideTextUntilHover || hov.hovered + onTapped: ring.showAlt = !ring.showAlt + } + Text { anchors.centerIn: parent - text: Cfg.Config.statsShowPercentByDefault - ? (hov.hovered ? ring.label : Math.round(ring.value) + "%") - : (hov.hovered ? Math.round(ring.value) + "%" : ring.label) + + + text: { + if (Cfg.Config.statsHideTextUntilHover) { + if (!hov.hovered) return "" + var showPct = ring.showAlt + ? !Cfg.Config.statsShowPercentByDefault + : Cfg.Config.statsShowPercentByDefault + return showPct ? Math.round(ring.value) + "%" : ring.label + } else { + var baseShowPct = Cfg.Config.statsShowPercentByDefault + ? !hov.hovered + : hov.hovered + var finalShowPct = ring.showAlt ? !baseShowPct : baseShowPct + return finalShowPct ? Math.round(ring.value) + "%" : ring.label + } + } + color: ring.labelColor font.pixelSize: Cfg.Config.statsRingFontSize font.bold: true font.family: "monospace" + + opacity: (Cfg.Config.statsHideTextUntilHover && !hov.hovered) ? 0 : 1 + Behavior on opacity { + NumberAnimation { duration: 180; easing.type: Easing.OutCubic } + } } } @@ -178,4 +214,3 @@ Rectangle { } } } - diff --git a/config/config.qml b/config/config.qml index 2418bf6..140609a 100644 --- a/config/config.qml +++ b/config/config.qml @@ -29,7 +29,7 @@ QtObject { property var rightModules: ["Tray", "Notifications", "Volume", "Clock"] // ── Arch Logo ───────────────────────────────────────────────────────────── - property int logoIconSize: 22 // icon font size; container width scales with it + property int logoIconSize: 23 // icon font size; container width scales with it property string logoIcon: "󱄅" // Nerd Font glyph for the logo // ── Panel Styling ───────────────────────────────────────────────────────── @@ -54,9 +54,15 @@ QtObject { property int trayIconSize: 20 // ── Stats Styling ───────────────────────────────────────────────────────── - property int statsRingSize: 25 - property int statsRingFontSize: 10 - property bool statsShowPercentByDefault: true + property int statsRingSize: 23 + property int statsRingFontSize: 10 + // If true, the % value is shown by default; hovering shows the label, clicking swaps back. + // If false, the label is shown by default; hovering shows the %, clicking swaps back. + property bool statsShowPercentByDefault: true + // If true, text is hidden completely until you hover a ring. + // • Hover → shows the "default" value (% when statsShowPercentByDefault, label otherwise) + // • Click → swaps to the "other" value (label / %) + property bool statsHideTextUntilHover: false // ── Volume Module ───────────────────────────────────────────────────────── property int volumeIconSize: 20 diff --git a/config/themes/goldencity.qml b/config/themes/goldencity.qml index 9450ffa..83ee675 100644 --- a/config/themes/goldencity.qml +++ b/config/themes/goldencity.qml @@ -167,7 +167,7 @@ QtObject { readonly property color notifHistoryEmpty: textDim // ── BgDate Module ────────────────────────────────────────────────────────── - readonly property color bgDateText: textMain // Date string color - readonly property color bgDateShadow: "#66000000" // Drop shadow for both texts - readonly property color bgDateSecondsText: textMain // Seconds clock — sun-glow gold + readonly property color bgDateText: "#ffffffff" // Pure white (brightest possible) + readonly property color bgDateShadow: "#88000000" // Slightly softer shadow to let the white glow + readonly property color bgDateSecondsText: bgDateText // Brighter, more "sunlight" gold/yellow } diff --git a/shell.qml b/shell.qml index 69f416f..84722a7 100644 --- a/shell.qml +++ b/shell.qml @@ -11,7 +11,7 @@ import "config" as Cfg ShellRoot { id: root - + readonly property bool isTop: Cfg.Config.barPosition === "top" property color frameBackground: Cfg.Config.theme.bgFrame