Skip to content

Commit

Permalink
[ui] sequence player: minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mugulmd committed Apr 25, 2023
1 parent 633ff59 commit ba2d684
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions meshroom/ui/qml/Viewer/SequencePlayer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ FloatingPane {
onSyncSelectedChanged: {
updateReconstructionView();
}

onPlayingChanged: {
syncSelected = !playing;
}
}

// Exposed properties
Expand Down Expand Up @@ -174,6 +178,7 @@ FloatingPane {
id: frameLabel

text: m.frame
Layout.preferredWidth: frameMetrics.width
}

Slider {
Expand Down Expand Up @@ -203,8 +208,6 @@ FloatingPane {
}
}

property real frameLength: m.sortedViewIds.length > 0 ? width / m.sortedViewIds.length : 0

background: Rectangle {
x: frameSlider.leftPadding
y: frameSlider.topPadding + frameSlider.height / 2 - height / 2
Expand All @@ -214,12 +217,15 @@ FloatingPane {
color: Colors.grey

Repeater {
id: cacheView

model: viewer ? viewer.cachedFrames : []
property real frameLength: m.sortedViewIds.length > 0 ? frameSlider.width / m.sortedViewIds.length : 0

Rectangle {
x: modelData.x * frameSlider.frameLength
x: modelData.x * cacheView.frameLength
y: 0
width: frameSlider.frameLength * (modelData.y - modelData.x + 1)
width: cacheView.frameLength * (modelData.y - modelData.x + 1)
height: 4
radius: 2
color: Colors.blue
Expand Down Expand Up @@ -263,6 +269,13 @@ FloatingPane {
}
}

TextMetrics {
id: frameMetrics

font: frameLabel.font
text: "10000"
}

TextMetrics {
id: fpsMetrics

Expand Down
2 changes: 1 addition & 1 deletion meshroom/ui/qml/Viewer/Viewer2D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ FocusScope {
'canBeHovered': false,
'idView': Qt.binding(function() { return (_reconstruction ? _reconstruction.selectedViewId : -1); }),
'cropFisheye': false,
'sequence': Qt.binding(function() { return ((_reconstruction && _reconstruction.viewpoints) ? _reconstruction.allImagePaths() : []) }),
'sequence': Qt.binding(function() { return ((_reconstruction && _reconstruction.viewpoints.count > 0) ? _reconstruction.allImagePaths() : []) }),
'useSequence': Qt.binding(function() { return !useExternal && _reconstruction && (!displayedNode || outputAttribute.name == "gallery"); })
})
} else {
Expand Down

0 comments on commit ba2d684

Please sign in to comment.