fixed Crypto.qml glitch and a bug in Volume.qml typing
This commit is contained in:
@@ -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 + "%" })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user