feat: Optimize capsule color computation by using Style.qml property

This commit is contained in:
loner
2025-11-17 11:05:58 +08:00
parent a201b8a2c8
commit 24b8eeb1f4
22 changed files with 26 additions and 23 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ Item {
width: root.width
height: pillHeight
radius: halfPillHeight
color: hovered ? Color.mHover : Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent
color: hovered ? Color.mHover : Style.capsuleColor
anchors.verticalCenter: parent.verticalCenter
readonly property int halfPillHeight: Math.round(pillHeight * 0.5)
+1 -1
View File
@@ -89,7 +89,7 @@ Item {
width: buttonSize
height: revealed ? (buttonSize + maxPillHeight - pillOverlap) : buttonSize
radius: halfButtonSize
color: hovered ? Color.mHover : Settings.data.bar.showCapsule ? Qt.alpha(Color.mSurfaceVariant, Settings.data.bar.capsuleOpacity) : Color.transparent
color: hovered ? Color.mHover : Style.capsuleColor
readonly property int halfButtonSize: Math.round(buttonSize * 0.5)