From 8b7911cff92f929107ca4f27414caf3288e7695d Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Fri, 21 May 2021 14:06:34 +0200 Subject: [PATCH] fix(Components): add proper foreground color for StatusBadge Fixes #59 --- ui/StatusQ/src/StatusQ/Components/StatusBadge.qml | 2 +- ui/StatusQ/src/StatusQ/Core/Theme/StatusDarkTheme.qml | 4 ++++ ui/StatusQ/src/StatusQ/Core/Theme/StatusLightTheme.qml | 4 ++++ ui/StatusQ/src/StatusQ/Core/Theme/ThemePalette.qml | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusBadge.qml b/ui/StatusQ/src/StatusQ/Components/StatusBadge.qml index 11033b0c4e..fd0577efaa 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusBadge.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusBadge.qml @@ -28,7 +28,7 @@ Rectangle { visible: statusBadge.value > 0 font.pixelSize: statusBadge.value > 99 ? 10 : 12 font.weight: Font.Bold - color: Theme.palette.white + color: Theme.palette.statusBadge.foregroundColor anchors.centerIn: parent text: { if (statusBadge.value > 99) { diff --git a/ui/StatusQ/src/StatusQ/Core/Theme/StatusDarkTheme.qml b/ui/StatusQ/src/StatusQ/Core/Theme/StatusDarkTheme.qml index eae0a246db..0ec738afec 100644 --- a/ui/StatusQ/src/StatusQ/Core/Theme/StatusDarkTheme.qml +++ b/ui/StatusQ/src/StatusQ/Core/Theme/StatusDarkTheme.qml @@ -120,5 +120,9 @@ ThemePalette { property QtObject statusAppNavBar: QtObject { property color backgroundColor: baseColor5 } + + property QtObject statusBadge: QtObject { + property color foregroundColor: baseColor3 + } } diff --git a/ui/StatusQ/src/StatusQ/Core/Theme/StatusLightTheme.qml b/ui/StatusQ/src/StatusQ/Core/Theme/StatusLightTheme.qml index 7d49e87cbe..9ece9d784e 100644 --- a/ui/StatusQ/src/StatusQ/Core/Theme/StatusLightTheme.qml +++ b/ui/StatusQ/src/StatusQ/Core/Theme/StatusLightTheme.qml @@ -120,5 +120,9 @@ ThemePalette { property QtObject statusAppNavBar: QtObject { property color backgroundColor: baseColor4 } + + property QtObject statusBadge: QtObject { + property color foregroundColor: white + } } diff --git a/ui/StatusQ/src/StatusQ/Core/Theme/ThemePalette.qml b/ui/StatusQ/src/StatusQ/Core/Theme/ThemePalette.qml index 14455c63b1..5c02d04134 100644 --- a/ui/StatusQ/src/StatusQ/Core/Theme/ThemePalette.qml +++ b/ui/StatusQ/src/StatusQ/Core/Theme/ThemePalette.qml @@ -82,6 +82,10 @@ QtObject { property color backgroundColor } + property QtObject statusBadge: QtObject { + property color foregroundColor + } + function alphaColor(color, alpha) { let actualColor = Qt.darker(color, 1) actualColor.a = alpha