diff --git a/Modules/Bar/Extras/BarPill.qml b/Modules/Bar/Extras/BarPill.qml index b158f834..284ad8d1 100644 --- a/Modules/Bar/Extras/BarPill.qml +++ b/Modules/Bar/Extras/BarPill.qml @@ -20,6 +20,8 @@ Item { property bool oppositeDirection: false property bool hovered: false property bool rotateText: false + property color customBackgroundColor: Qt.rgba(0, 0, 0, 0) + property color customTextIconColor: Qt.rgba(0, 0, 0, 0) readonly property string barPosition: Settings.data.bar.position readonly property bool isVerticalBar: barPosition === "left" || barPosition === "right" @@ -57,6 +59,8 @@ Item { hovered: root.hovered density: root.density rotateText: root.rotateText + customBackgroundColor: root.customBackgroundColor + customTextIconColor: root.customTextIconColor onShown: root.shown() onHidden: root.hidden() onEntered: root.entered() @@ -82,6 +86,8 @@ Item { oppositeDirection: root.oppositeDirection hovered: root.hovered density: root.density + customBackgroundColor: root.customBackgroundColor + customTextIconColor: root.customTextIconColor onShown: root.shown() onHidden: root.hidden() onEntered: root.entered() diff --git a/Modules/Bar/Extras/BarPillHorizontal.qml b/Modules/Bar/Extras/BarPillHorizontal.qml index 1d3a4967..355548e7 100644 --- a/Modules/Bar/Extras/BarPillHorizontal.qml +++ b/Modules/Bar/Extras/BarPillHorizontal.qml @@ -20,6 +20,8 @@ Item { property bool forceClose: false property bool oppositeDirection: false property bool hovered: false + property color customBackgroundColor: Qt.rgba(0, 0, 0, 0) + property color customTextIconColor: Qt.rgba(0, 0, 0, 0) // Effective shown state (true if hovered/animated open or forced) readonly property bool revealed: !forceClose && (forceOpen || showPill) @@ -78,7 +80,7 @@ Item { width: root.width height: pillHeight radius: halfPillHeight - color: hovered ? Color.mHover : Style.capsuleColor + color: hovered ? (customBackgroundColor.a > 0 ? Qt.lighter(customBackgroundColor, 1.1) : Color.mHover) : (customBackgroundColor.a > 0 ? customBackgroundColor : Style.capsuleColor) anchors.verticalCenter: parent.verticalCenter readonly property int halfPillHeight: Math.round(pillHeight * 0.5) @@ -129,7 +131,7 @@ Item { pointSize: textSize applyUiScale: false font.weight: Style.fontWeightBold - color: hovered ? Color.mOnHover : (forceOpen ? Color.mOnSurface : Color.mPrimary) + color: hovered ? (customTextIconColor.a > 0 ? customTextIconColor : Color.mOnHover) : (customTextIconColor.a > 0 ? customTextIconColor : (forceOpen ? Color.mOnSurface : Color.mPrimary)) visible: revealed } @@ -163,7 +165,7 @@ Item { icon: root.icon pointSize: iconSize applyUiScale: false - color: hovered ? Color.mOnHover : Color.mOnSurface + color: hovered ? (customTextIconColor.a > 0 ? customTextIconColor : Color.mOnHover) : (customTextIconColor.a > 0 ? customTextIconColor : Color.mOnSurface) // Center horizontally x: (iconCircle.width - width) / 2 // Center vertically accounting for font metrics diff --git a/Modules/Bar/Extras/BarPillVertical.qml b/Modules/Bar/Extras/BarPillVertical.qml index 6ac17686..ed6b69e9 100644 --- a/Modules/Bar/Extras/BarPillVertical.qml +++ b/Modules/Bar/Extras/BarPillVertical.qml @@ -21,6 +21,8 @@ Item { property bool oppositeDirection: false property bool hovered: false property bool rotateText: false + property color customBackgroundColor: Qt.rgba(0, 0, 0, 0) + property color customTextIconColor: Qt.rgba(0, 0, 0, 0) // Bar position detection for pill direction readonly property string barPosition: Settings.data.bar.position @@ -91,7 +93,7 @@ Item { width: buttonSize height: revealed ? (buttonSize + maxPillHeight - pillOverlap) : buttonSize radius: halfButtonSize - color: hovered ? Color.mHover : Style.capsuleColor + color: hovered ? (customBackgroundColor.a > 0 ? Qt.lighter(customBackgroundColor, 1.1) : Color.mHover) : (customBackgroundColor.a > 0 ? customBackgroundColor : Style.capsuleColor) readonly property int halfButtonSize: Math.round(buttonSize * 0.5) @@ -139,7 +141,7 @@ Item { font.weight: Style.fontWeightMedium horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - color: hovered ? Color.mOnHover : (forceOpen ? Color.mOnSurface : Color.mPrimary) + color: hovered ? (customTextIconColor.a > 0 ? customTextIconColor : Color.mOnHover) : (customTextIconColor.a > 0 ? customTextIconColor : (forceOpen ? Color.mOnSurface : Color.mPrimary)) visible: revealed function getVerticalCenterOffset() { @@ -189,7 +191,7 @@ Item { icon: root.icon pointSize: iconSize applyUiScale: false - color: hovered ? Color.mOnHover : Color.mOnSurface + color: hovered ? (customTextIconColor.a > 0 ? customTextIconColor : Color.mOnHover) : (customTextIconColor.a > 0 ? customTextIconColor : Color.mOnSurface) // Center horizontally x: (iconCircle.width - width) / 2 // Center vertically accounting for font metrics diff --git a/Modules/Bar/Widgets/Battery.qml b/Modules/Bar/Widgets/Battery.qml index bb99700d..a1739cc7 100644 --- a/Modules/Bar/Widgets/Battery.qml +++ b/Modules/Bar/Widgets/Battery.qml @@ -34,10 +34,11 @@ Item { readonly property bool isBarVertical: Settings.data.bar.position === "left" || Settings.data.bar.position === "right" readonly property string displayMode: widgetSettings.displayMode !== undefined ? widgetSettings.displayMode : widgetMetadata.displayMode readonly property real warningThreshold: widgetSettings.warningThreshold !== undefined ? widgetSettings.warningThreshold : widgetMetadata.warningThreshold + readonly property bool isLowBattery: !charging && percent <= warningThreshold // Test mode readonly property bool testMode: false - readonly property int testPercent: 100 + readonly property int testPercent: 15 readonly property bool testCharging: false // Main properties @@ -120,6 +121,8 @@ Item { autoHide: false forceOpen: isReady && (testMode || battery.isLaptopBattery) && displayMode === "alwaysShow" forceClose: displayMode === "alwaysHide" || !isReady || (!testMode && !battery.isLaptopBattery) + customBackgroundColor: isLowBattery ? Color.mError : Qt.rgba(0, 0, 0, 0) + customTextIconColor: isLowBattery ? Color.mOnError : Qt.rgba(0, 0, 0, 0) tooltipText: { let lines = []; if (testMode) {