feat(transport): editable frame field + uniform spacing
This commit is contained in:
@@ -8,6 +8,7 @@ import ISC
|
|||||||
// Right-rail panel with three bordered sections: READOUT, DISPLAY, THRESHOLDS.
|
// Right-rail panel with three bordered sections: READOUT, DISPLAY, THRESHOLDS.
|
||||||
// Cards match the left-rail SOURCE / CONNECTION FLOW style.
|
// Cards match the left-rail SOURCE / CONNECTION FLOW style.
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
spacing: 6
|
spacing: 6
|
||||||
property var s: streamController.stats
|
property var s: streamController.stats
|
||||||
property alias showLabels: labelsToggle.checked
|
property alias showLabels: labelsToggle.checked
|
||||||
|
|||||||
@@ -42,15 +42,69 @@ Item {
|
|||||||
spacing: 24
|
spacing: 24
|
||||||
|
|
||||||
// Frame counter
|
// Frame counter
|
||||||
Text {
|
Row {
|
||||||
|
spacing: 6
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: "Frame " + (streamController.frameIndex + 1)
|
|
||||||
+ " / " + streamController.frameTotal
|
Label {
|
||||||
|
text: "Frame"
|
||||||
color: Theme.sideMutedText
|
color: Theme.sideMutedText
|
||||||
font.family: Theme.uiFontFamily
|
font.family: Theme.uiFontFamily
|
||||||
font.pixelSize: Theme.fontMd
|
font.pixelSize: Theme.fontMd
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
leftPadding: 8
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: frameInput
|
||||||
|
text: String(streamController.frameIndex + 1)
|
||||||
|
font.pixelSize: Theme.fontMd
|
||||||
|
font.weight: Font.Medium
|
||||||
|
font.family: Theme.codeFontFamily
|
||||||
|
color: Theme.headingColor
|
||||||
|
verticalAlignment: TextInput.AlignVCenter
|
||||||
|
horizontalAlignment: TextInput.AlignHCenter
|
||||||
|
selectByMouse: true
|
||||||
|
inputMethodHints: Qt.ImhDigitsOnly
|
||||||
|
padding: 0
|
||||||
|
width: Math.max(44, contentWidth + 16)
|
||||||
|
height: 28
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: Theme.fieldBackground
|
||||||
|
radius: Theme.radiusXs
|
||||||
|
border.color: frameInput.activeFocus ? Theme.fieldBorderFocus : (frameInput.hovered ? Theme.fieldBorderFocus : Theme.sideBorder)
|
||||||
|
border.width: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
onEditingFinished: {
|
||||||
|
var val = parseInt(text)
|
||||||
|
if (!isNaN(val)) {
|
||||||
|
var targetFrame = Math.max(1, Math.min(val, streamController.frameTotal))
|
||||||
|
streamController.seek(targetFrame - 1)
|
||||||
|
}
|
||||||
|
text = String(streamController.frameIndex + 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: streamController
|
||||||
|
function onFrameUpdated() {
|
||||||
|
if (!frameInput.activeFocus) {
|
||||||
|
frameInput.text = String(streamController.frameIndex + 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: "/ " + streamController.frameTotal
|
||||||
|
color: Theme.sideMutedText
|
||||||
|
font.family: Theme.uiFontFamily
|
||||||
|
font.pixelSize: Theme.fontMd
|
||||||
|
font.weight: Font.Medium
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Separator 1
|
// Separator 1
|
||||||
@@ -124,7 +178,7 @@ Item {
|
|||||||
Button {
|
Button {
|
||||||
id: playPauseBtn
|
id: playPauseBtn
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
implicitWidth: 64
|
implicitWidth: 56
|
||||||
implicitHeight: 56
|
implicitHeight: 56
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|||||||
Reference in New Issue
Block a user