fixed Crypto.qml glitch and a bug in Volume.qml typing

This commit is contained in:
SomeElse
2026-05-23 07:45:22 +00:00
parent b80615e21d
commit 390525ac72
5 changed files with 336 additions and 7 deletions

View File

@@ -150,12 +150,19 @@ ModuleChip {
cardHeight: popupCol.implicitHeight + 34
hasKeyboardFocus: true
ColumnLayout {
Item {
id: popupCol
anchors { left: parent.left; right: parent.right; top: parent.top }
anchors.margins: 16
anchors.topMargin: 18
spacing: 14
implicitWidth: popupContent.implicitWidth
implicitHeight: popupContent.implicitHeight
focus: true
ColumnLayout {
id: popupContent
anchors.fill: parent
spacing: 14
VolumeSection {
id: outputSection
@@ -248,6 +255,13 @@ ModuleChip {
}
Item { height: 2 }
}
MouseArea {
anchors.fill: parent
z: -1
onClicked: popupCol.forceActiveFocus()
}
}
}
component VolumeSection: ColumnLayout {
@@ -310,13 +324,18 @@ ModuleChip {
if (!vs.muted) {
let val = parseInt(text.replace("%", "").trim(), 10)
if (!isNaN(val)) vs.sliderMoved(Math.max(0, Math.min(vs.maxVolume, val)))
text = vs.volume + "%"
text = Qt.binding(function() { return vs.muted ? "muted" : vs.volume + "%" })
}
popupCol.forceActiveFocus()
}
onActiveFocusChanged: {
if (activeFocus && !vs.muted) {
text = vs.volume.toString()
selectAll()
} else if (!activeFocus && !vs.muted) {
let val = parseInt(text.replace("%", "").trim(), 10)
if (!isNaN(val)) vs.sliderMoved(Math.max(0, Math.min(vs.maxVolume, val)))
text = Qt.binding(function() { return vs.muted ? "muted" : vs.volume + "%" })
}
}
}
@@ -525,7 +544,8 @@ ModuleChip {
onAccepted: {
let val = parseInt(text.replace("%", "").trim(), 10)
if (!isNaN(val)) lr.valueSet(Math.max(lr.minValue, Math.min(lr.maxValue, val)))
text = lr.value + "%"
text = Qt.binding(function() { return lr.value + "%" })
popupCol.forceActiveFocus()
}
onActiveFocusChanged: {
if (activeFocus) {
@@ -534,7 +554,7 @@ ModuleChip {
} else {
let val = parseInt(text.replace("%", "").trim(), 10)
if (!isNaN(val)) lr.valueSet(Math.max(lr.minValue, Math.min(lr.maxValue, val)))
text = lr.value + "%"
text = Qt.binding(function() { return lr.value + "%" })
}
}
}