make BarComponent color inherit from bar's color

This commit is contained in:
lucy 2026-10-26 13:42:37 +01:00
commit c54e82d429
2 changed files with 24 additions and 19 deletions

View file

@ -4,8 +4,13 @@ import qs
import qs.settings
Rectangle {
property color base: active ? Colors.c.base02 : Colors.c.base01
id: root
readonly property color barColor: Colors.c.base00
property real lightnessBoost: 0.07
property real activeBoost: 0.06
property bool active: false
readonly property real baseLightness: Math.min(1.0, barColor.hslLightness + lightnessBoost)
property color base: Qt.hsla(barColor.hslHue, barColor.hslSaturation, active ? Math.min(1.0, baseLightness + activeBoost) : baseLightness)
color: base
implicitHeight: Config.cfg.bar.height - 8
radius: Config.cfg.appearance.rounding - 4