mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[ui] ImageGallery: Harmonize functions and indentation
This commit is contained in:
parent
59be396244
commit
2e31ecaea7
1 changed files with 50 additions and 49 deletions
|
@ -42,7 +42,7 @@ Panel {
|
||||||
property bool readOnly: root.readOnly || displayHDR.checked
|
property bool readOnly: root.readOnly || displayHDR.checked
|
||||||
|
|
||||||
onViewpointsChanged: {
|
onViewpointsChanged: {
|
||||||
ThumbnailCache.clearRequests();
|
ThumbnailCache.clearRequests()
|
||||||
}
|
}
|
||||||
|
|
||||||
onIntrinsicsChanged: {
|
onIntrinsicsChanged: {
|
||||||
|
@ -60,8 +60,7 @@ Panel {
|
||||||
_reconstruction.cameraInitIndex = newIndex
|
_reconstruction.cameraInitIndex = newIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
function populate_model()
|
function populate_model() {
|
||||||
{
|
|
||||||
intrinsicModel.clear()
|
intrinsicModel.clear()
|
||||||
for (var intr in parsedIntrinsic) {
|
for (var intr in parsedIntrinsic) {
|
||||||
intrinsicModel.appendRow(parsedIntrinsic[intr])
|
intrinsicModel.appendRow(parsedIntrinsic[intr])
|
||||||
|
@ -70,8 +69,7 @@ Panel {
|
||||||
|
|
||||||
function parseIntr() {
|
function parseIntr() {
|
||||||
parsedIntrinsic = []
|
parsedIntrinsic = []
|
||||||
if(!m.intrinsics)
|
if(!m.intrinsics) {
|
||||||
{
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,8 +95,7 @@ Panel {
|
||||||
// Table Model needs to contain an entry for each column.
|
// Table Model needs to contain an entry for each column.
|
||||||
// In case of old file formats, some intrinsic keys that we display may not exist in the model.
|
// In case of old file formats, some intrinsic keys that we display may not exist in the model.
|
||||||
// So, here we create an empty entry to enforce that the key exists in the model.
|
// So, here we create an empty entry to enforce that the key exists in the model.
|
||||||
for(var n = 0; n < intrinsicModel.columnNames.length; ++n)
|
for(var n = 0; n < intrinsicModel.columnNames.length; ++n) {
|
||||||
{
|
|
||||||
var name = intrinsicModel.columnNames[n]
|
var name = intrinsicModel.columnNames[n]
|
||||||
if(!(name in intrinsic)) {
|
if(!(name in intrinsic)) {
|
||||||
intrinsic[name] = {}
|
intrinsic[name] = {}
|
||||||
|
@ -187,12 +184,11 @@ Panel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function makeCurrentItemVisible()
|
function makeCurrentItemVisible() {
|
||||||
{
|
|
||||||
grid.positionViewAtIndex(grid.currentIndex, GridView.Visible)
|
grid.positionViewAtIndex(grid.currentIndex, GridView.Visible)
|
||||||
}
|
}
|
||||||
function updateCurrentIndexFromSelectionViewId()
|
|
||||||
{
|
function updateCurrentIndexFromSelectionViewId() {
|
||||||
var idx = grid.model.find(_reconstruction.selectedViewId, "viewId")
|
var idx = grid.model.find(_reconstruction.selectedViewId, "viewId")
|
||||||
if (idx >= 0 && grid.currentIndex != idx) {
|
if (idx >= 0 && grid.currentIndex != idx) {
|
||||||
grid.currentIndex = idx
|
grid.currentIndex = idx
|
||||||
|
@ -250,8 +246,7 @@ Panel {
|
||||||
var roleNameAndCmd = roleName_.split(".");
|
var roleNameAndCmd = roleName_.split(".");
|
||||||
var roleName = roleName_;
|
var roleName = roleName_;
|
||||||
var cmd = "";
|
var cmd = "";
|
||||||
if(roleNameAndCmd.length >= 2)
|
if(roleNameAndCmd.length >= 2) {
|
||||||
{
|
|
||||||
roleName = roleNameAndCmd[0];
|
roleName = roleNameAndCmd[0];
|
||||||
cmd = roleNameAndCmd[1];
|
cmd = roleNameAndCmd[1];
|
||||||
}
|
}
|
||||||
|
@ -284,8 +279,7 @@ Panel {
|
||||||
grid.currentIndex = DelegateModel.filteredIndex
|
grid.currentIndex = DelegateModel.filteredIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendRemoveRequest()
|
function sendRemoveRequest() {
|
||||||
{
|
|
||||||
if(!readOnly)
|
if(!readOnly)
|
||||||
removeImageRequest(object)
|
removeImageRequest(object)
|
||||||
}
|
}
|
||||||
|
@ -542,7 +536,8 @@ Panel {
|
||||||
"serialNumber",
|
"serialNumber",
|
||||||
"principalPoint.x",
|
"principalPoint.x",
|
||||||
"principalPoint.y",
|
"principalPoint.y",
|
||||||
"locked"]
|
"locked"
|
||||||
|
]
|
||||||
|
|
||||||
TableModelColumn { display: function(modelIndex){return parsedIntrinsic[modelIndex.row][intrinsicModel.columnNames[0]]} }
|
TableModelColumn { display: function(modelIndex){return parsedIntrinsic[modelIndex.row][intrinsicModel.columnNames[0]]} }
|
||||||
TableModelColumn { display: function(modelIndex){return parsedIntrinsic[modelIndex.row][intrinsicModel.columnNames[1]]} }
|
TableModelColumn { display: function(modelIndex){return parsedIntrinsic[modelIndex.row][intrinsicModel.columnNames[1]]} }
|
||||||
|
@ -662,10 +657,10 @@ Panel {
|
||||||
|
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
sortedModel.reconstructionFilter = true;
|
sortedModel.reconstructionFilter = true
|
||||||
inputImagesFilterButton.checked = false;
|
inputImagesFilterButton.checked = false
|
||||||
nonEstimatedCamerasFilterButton.checked = false;
|
nonEstimatedCamerasFilterButton.checked = false
|
||||||
intrinsicsFilterButton.checked = false;
|
intrinsicsFilterButton.checked = false
|
||||||
} else {
|
} else {
|
||||||
if (inputImagesFilterButton.checked === false && nonEstimatedCamerasFilterButton.checked === false && intrinsicsFilterButton.checked === false)
|
if (inputImagesFilterButton.checked === false && nonEstimatedCamerasFilterButton.checked === false && intrinsicsFilterButton.checked === false)
|
||||||
inputImagesFilterButton.checked = true
|
inputImagesFilterButton.checked = true
|
||||||
|
@ -673,12 +668,13 @@ Panel {
|
||||||
}
|
}
|
||||||
onEnabledChanged: {
|
onEnabledChanged: {
|
||||||
if(!enabled) {
|
if(!enabled) {
|
||||||
if(checked) inputImagesFilterButton.checked = true;
|
if(checked)
|
||||||
|
inputImagesFilterButton.checked = true
|
||||||
checked = false
|
checked = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Non estimated cameras count
|
// Non estimated cameras count
|
||||||
MaterialToolLabelButton {
|
MaterialToolLabelButton {
|
||||||
id : nonEstimatedCamerasFilterButton
|
id : nonEstimatedCamerasFilterButton
|
||||||
|
@ -694,10 +690,10 @@ Panel {
|
||||||
|
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
sortedModel.reconstructionFilter = false;
|
sortedModel.reconstructionFilter = false
|
||||||
inputImagesFilterButton.checked = false;
|
inputImagesFilterButton.checked = false
|
||||||
estimatedCamerasFilterButton.checked = false;
|
estimatedCamerasFilterButton.checked = false
|
||||||
intrinsicsFilterButton.checked = false;
|
intrinsicsFilterButton.checked = false
|
||||||
} else {
|
} else {
|
||||||
if (inputImagesFilterButton.checked === false && estimatedCamerasFilterButton.checked === false && intrinsicsFilterButton.checked === false)
|
if (inputImagesFilterButton.checked === false && estimatedCamerasFilterButton.checked === false && intrinsicsFilterButton.checked === false)
|
||||||
inputImagesFilterButton.checked = true
|
inputImagesFilterButton.checked = true
|
||||||
|
@ -705,12 +701,13 @@ Panel {
|
||||||
}
|
}
|
||||||
onEnabledChanged: {
|
onEnabledChanged: {
|
||||||
if(!enabled) {
|
if(!enabled) {
|
||||||
if(checked) inputImagesFilterButton.checked = true;
|
if(checked)
|
||||||
|
inputImagesFilterButton.checked = true
|
||||||
checked = false
|
checked = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialToolLabelButton {
|
MaterialToolLabelButton {
|
||||||
id : intrinsicsFilterButton
|
id : intrinsicsFilterButton
|
||||||
Layout.minimumWidth: childrenRect.width
|
Layout.minimumWidth: childrenRect.width
|
||||||
|
@ -719,7 +716,6 @@ Panel {
|
||||||
label: _reconstruction ? (m.intrinsics ? m.intrinsics.count : 0) : "0"
|
label: _reconstruction ? (m.intrinsics ? m.intrinsics.count : 0) : "0"
|
||||||
padding: 3
|
padding: 3
|
||||||
|
|
||||||
|
|
||||||
enabled: m.intrinsics ? m.intrinsics.count > 0 : false
|
enabled: m.intrinsics ? m.intrinsics.count > 0 : false
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: false
|
checked: false
|
||||||
|
@ -736,15 +732,17 @@ Panel {
|
||||||
}
|
}
|
||||||
onEnabledChanged: {
|
onEnabledChanged: {
|
||||||
if(!enabled) {
|
if(!enabled) {
|
||||||
if(checked) inputImagesFilterButton.checked = true;
|
if(checked)
|
||||||
|
inputImagesFilterButton.checked = true
|
||||||
checked = false
|
checked = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item { Layout.fillHeight: true; Layout.fillWidth: true }
|
Item {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
MaterialToolLabelButton {
|
MaterialToolLabelButton {
|
||||||
id: displayHDR
|
id: displayHDR
|
||||||
|
@ -832,7 +830,10 @@ Panel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item { Layout.fillHeight: true; width: 1 }
|
Item {
|
||||||
|
Layout.fillHeight: true
|
||||||
|
width: 1
|
||||||
|
}
|
||||||
|
|
||||||
// Thumbnail size icon and slider
|
// Thumbnail size icon and slider
|
||||||
MaterialToolButton {
|
MaterialToolButton {
|
||||||
|
@ -843,7 +844,7 @@ Panel {
|
||||||
padding: 0
|
padding: 0
|
||||||
anchors.margins: 0
|
anchors.margins: 0
|
||||||
font.pointSize: 11
|
font.pointSize: 11
|
||||||
onClicked: { thumbnailSizeSlider.value = defaultCellSize; }
|
onClicked: { thumbnailSizeSlider.value = defaultCellSize }
|
||||||
}
|
}
|
||||||
Slider {
|
Slider {
|
||||||
id: thumbnailSizeSlider
|
id: thumbnailSizeSlider
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue