improved code by removing redundancies and done some optimizations

This commit is contained in:
SomeElse
2026-05-05 03:58:40 +00:00
parent 8f25ee5caf
commit 046a36fbec
13 changed files with 441 additions and 663 deletions

View File

@@ -356,7 +356,7 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter
Layout.preferredWidth: 44
}
// ── Mute toggle button ────────────────────────────────────────
Rectangle {
width: 22; height: 22; radius: 6
color: muteHover.hovered ? (vs.muted ? "#33ffffff" : "#22ffffff") : (vs.muted ? root.t.volMuteBg : "transparent")
@@ -387,7 +387,7 @@ Rectangle {
color: vs.muted ? vs.dimColor : vs.accentColor
}
}
// ── Volume slider handle ──────────────────────────────────────
Rectangle {
readonly property real ratio: vs.volume / Math.max(1, vs.maxVolume)
x: Math.min(sliderItem.width - width, Math.max(0, sliderItem.width * ratio - width / 2))
@@ -427,7 +427,7 @@ Rectangle {
elide: Text.ElideRight
Layout.fillWidth: true
}
// ── Device picker chevron ─────────────────────────────────────
Rectangle {
width: 20; height: 20; radius: 5
color: chevHover.hovered ? "#22ffffff" : "transparent"
@@ -472,7 +472,6 @@ Rectangle {
readonly property bool isActive: vs.currentNode !== null && modelData.id === vs.currentNode.id
Layout.fillWidth: true; height: 28; radius: 7
color: isActive ? Qt.alpha(vs.accentColor, 0.18) : (rowHover.hovered ? root.t.volPickerHover : "transparent")
// ── Device row border ─────────────────────────────
border.color: isActive ? Qt.alpha(vs.accentColor, 0.45) : "transparent"
border.width: Cfg.Config.popupBorderWidth
RowLayout {
@@ -523,7 +522,7 @@ Rectangle {
font.pixelSize: 11
Layout.fillWidth: true
}
// ── Decrement button ──────────────────────────────────────────────
Rectangle {
width: 22; height: 22; radius: 5
color: decHover.hovered ? "#22ffffff" : "transparent"
@@ -544,7 +543,7 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter
Layout.preferredWidth: 44
}
// ── Increment button ──────────────────────────────────────────────
Rectangle {
width: 22; height: 22; radius: 5
color: incHover.hovered ? "#22ffffff" : "transparent"