mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-08 22:01:59 +02:00
[Panorama Viewer] add mouse speed multiplier
This commit is contained in:
parent
b66a19d01e
commit
dadb875484
4 changed files with 44 additions and 5 deletions
|
@ -21,6 +21,8 @@ FloatingPane {
|
||||||
property int subdivisionsDefaultValue: 12
|
property int subdivisionsDefaultValue: 12
|
||||||
property int subdivisionsValue: subdivisionsCtrl.value
|
property int subdivisionsValue: subdivisionsCtrl.value
|
||||||
|
|
||||||
|
property int mouseSpeed: speedSpinBox.value
|
||||||
|
|
||||||
background: Rectangle { color: root.palette.window }
|
background: Rectangle { color: root.palette.window }
|
||||||
|
|
||||||
DoubleValidator {
|
DoubleValidator {
|
||||||
|
@ -100,11 +102,43 @@ FloatingPane {
|
||||||
stepSize: 2
|
stepSize: 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Fill rectangle to have a better UI
|
Rectangle{
|
||||||
Rectangle {
|
|
||||||
color: root.palette.window
|
color: root.palette.window
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
RowLayout{
|
||||||
|
ToolButton {
|
||||||
|
text: "Edit Speed"
|
||||||
|
|
||||||
|
ToolTip.visible: ToolTip.text && hovered
|
||||||
|
ToolTip.delay: 100
|
||||||
|
ToolTip.text: "Reset the mouse multiplier"
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
speedSpinBox.value = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SpinBox {
|
||||||
|
id: speedSpinBox
|
||||||
|
from: 1
|
||||||
|
value: 1
|
||||||
|
to: 10
|
||||||
|
stepSize: 1
|
||||||
|
Layout.fillWidth: false
|
||||||
|
Layout.maximumWidth: 50
|
||||||
|
|
||||||
|
|
||||||
|
validator: DoubleValidator {
|
||||||
|
bottom: Math.min(speedSpinBox.from, speedSpinBox.to)
|
||||||
|
top: Math.max(speedSpinBox.from, speedSpinBox.to)
|
||||||
|
}
|
||||||
|
|
||||||
|
textFromValue: function(value, locale) {
|
||||||
|
return "x" + value.toString()
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
RowLayout{
|
RowLayout{
|
||||||
ToolButton {
|
ToolButton {
|
||||||
text: "Downscale"
|
text: "Downscale"
|
||||||
|
@ -124,6 +158,7 @@ FloatingPane {
|
||||||
to: 3
|
to: 3
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
Layout.fillWidth: false
|
Layout.fillWidth: false
|
||||||
|
Layout.maximumWidth: 50
|
||||||
|
|
||||||
|
|
||||||
validator: DoubleValidator {
|
validator: DoubleValidator {
|
||||||
|
|
|
@ -29,6 +29,8 @@ AliceVision.PanoramaViewer {
|
||||||
|
|
||||||
property bool displayGridPano: true
|
property bool displayGridPano: true
|
||||||
|
|
||||||
|
property int mouseMultiplier: 1
|
||||||
|
|
||||||
onIsHighlightableChanged:{
|
onIsHighlightableChanged:{
|
||||||
for (var i = 0; i < repeater.model; i++) {
|
for (var i = 0; i < repeater.model; i++) {
|
||||||
repeater.itemAt(i).item.onChangedHighlightState(isHighlightable);
|
repeater.itemAt(i).item.onChangedHighlightState(isHighlightable);
|
||||||
|
@ -82,7 +84,7 @@ AliceVision.PanoramaViewer {
|
||||||
lastX = mouse.x;
|
lastX = mouse.x;
|
||||||
lastY = mouse.y;
|
lastY = mouse.y;
|
||||||
for (var i = 0; i < repeater.model; i++) {
|
for (var i = 0; i < repeater.model; i++) {
|
||||||
repeater.itemAt(i).item.rotatePanorama(xoffset * 0.001, yoffset*0.001)
|
repeater.itemAt(i).item.rotatePanorama(xoffset * 0.001 * mouseMultiplier, -yoffset * 0.001 * mouseMultiplier)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,6 +215,7 @@ AliceVision.PanoramaViewer {
|
||||||
root.status = Image.Ready;
|
root.status = Image.Ready;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateRepeater() {
|
function updateRepeater() {
|
||||||
if(repeater.model !== root.pathList.length){
|
if(repeater.model !== root.pathList.length){
|
||||||
repeater.model = 0;
|
repeater.model = 0;
|
||||||
|
|
|
@ -266,7 +266,8 @@ FocusScope {
|
||||||
'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}),
|
'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}),
|
||||||
'downscaleValue': Qt.binding(function(){return panoramaViewerToolbar.downscaleValue;}),
|
'downscaleValue': Qt.binding(function(){return panoramaViewerToolbar.downscaleValue;}),
|
||||||
'subdivisionsPano': Qt.binding(function(){ return panoramaViewerToolbar.subdivisionsValue;}),
|
'subdivisionsPano': Qt.binding(function(){ return panoramaViewerToolbar.subdivisionsValue;}),
|
||||||
'displayGridPano': Qt.binding(function(){ return panoramaViewerToolbar.displayGrid;})
|
'displayGridPano': Qt.binding(function(){ return panoramaViewerToolbar.displayGrid;}),
|
||||||
|
'mouseMultiplier': Qt.binding(function(){ return panoramaViewerToolbar.mouseSpeed;})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
|
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
|
||||||
|
|
|
@ -123,7 +123,7 @@ Item {
|
||||||
id: displayImagePathAction
|
id: displayImagePathAction
|
||||||
text: "Display Image Path"
|
text: "Display Image Path"
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: true
|
checked: true && !viewer2D.usePanoramaViewer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue