mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[ui] ImageGallery: use MaterialLabel for image status
* wrap them into Loaders
This commit is contained in:
parent
62961dedd9
commit
a93976451b
2 changed files with 31 additions and 46 deletions
|
@ -19,6 +19,8 @@ Item {
|
||||||
signal pressed(var mouse)
|
signal pressed(var mouse)
|
||||||
signal removeRequest()
|
signal removeRequest()
|
||||||
|
|
||||||
|
default property alias children: imageMA.children
|
||||||
|
|
||||||
// retrieve viewpoints inner data
|
// retrieve viewpoints inner data
|
||||||
QtObject {
|
QtObject {
|
||||||
id: _viewpoint
|
id: _viewpoint
|
||||||
|
|
|
@ -110,61 +110,44 @@ Panel {
|
||||||
Row {
|
Row {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.margins: 10
|
anchors.margins: 4
|
||||||
// Lens recognized
|
spacing: 2
|
||||||
ToolButton {
|
|
||||||
id: metadataIndicator
|
|
||||||
|
|
||||||
// object can be evaluated to null at some point during creation/deletion
|
property bool valid: Qt.isQtObject(object) // object can be evaluated to null at some point during creation/deletion
|
||||||
property bool valid: Qt.isQtObject(object)
|
property bool noMetadata: valid && !_reconstruction.hasMetadata(model.object)
|
||||||
property bool hasMetadata: _reconstruction.hasMetadata(model.object)
|
property bool noIntrinsic: valid && !_reconstruction.hasValidIntrinsic(model.object)
|
||||||
|
property bool inViews: valid && _reconstruction.sfmReport && _reconstruction.isInViews(object)
|
||||||
|
|
||||||
contentItem: Label {
|
// Missing metadata indicator
|
||||||
font.family: MaterialIcons.fontFamily
|
Loader {
|
||||||
|
active: parent.noMetadata
|
||||||
|
visible: active
|
||||||
|
sourceComponent: MaterialLabel {
|
||||||
text: MaterialIcons.info_outline
|
text: MaterialIcons.info_outline
|
||||||
color: parent.hasMetadata ? "#4CAF50" : "#F44336"
|
color: "#FF9800"
|
||||||
font.pointSize: 10
|
ToolTip.text: "No Metadata"
|
||||||
}
|
}
|
||||||
ToolTip.text: hasMetadata ? "Has Metadata" : "Missing Metadata"
|
|
||||||
ToolTip.visible: pressed
|
|
||||||
visible: valid && !hasMetadata
|
|
||||||
}
|
}
|
||||||
// Lens recognized
|
// Unknown camera instrinsics indicator
|
||||||
ToolButton {
|
Loader {
|
||||||
id: lensIndicator
|
active: parent.noIntrinsic
|
||||||
|
visible: active
|
||||||
// object can be evaluated to null at some point during creation/deletion
|
sourceComponent: MaterialLabel {
|
||||||
property bool valid: Qt.isQtObject(object)
|
text: MaterialIcons.camera
|
||||||
property bool hasValidIntrinsic: _reconstruction.hasValidIntrinsic(model.object)
|
color: "#FF9800"
|
||||||
|
ToolTip.text: "No Camera Instrinsic Parameters (missing Metadata?)"
|
||||||
contentItem: Label {
|
|
||||||
font.family: MaterialIcons.fontFamily
|
|
||||||
text: MaterialIcons.warning
|
|
||||||
color: "#F44336"
|
|
||||||
font.pointSize: 10
|
|
||||||
}
|
}
|
||||||
visible: valid && !hasValidIntrinsic
|
|
||||||
|
|
||||||
ToolTip.text: "Unable to find camera intrinsic parameters.\nCheck image metadata."
|
|
||||||
ToolTip.visible: pressed
|
|
||||||
}
|
}
|
||||||
// Reconstruction status indicator
|
// Reconstruction status indicator
|
||||||
ToolButton {
|
Loader {
|
||||||
id: statusIndicator
|
active: parent.inViews
|
||||||
|
visible: active
|
||||||
// object can be evaluated to null at some point during creation/deletion
|
sourceComponent: MaterialLabel {
|
||||||
property bool inViews: Qt.isQtObject(object) && _reconstruction.sfmReport && _reconstruction.isInViews(object)
|
property bool reconstructed: _reconstruction.isReconstructed(model.object)
|
||||||
property bool reconstructed: inViews && _reconstruction.isReconstructed(model.object)
|
text: reconstructed ? MaterialIcons.check_circle : MaterialIcons.remove_circle
|
||||||
|
color: reconstructed ? "#4CAF50" : "#F44336"
|
||||||
contentItem: Label {
|
ToolTip.text: reconstructed ? "Reconstructed" : "Not Reconstructed"
|
||||||
font.family: MaterialIcons.fontFamily
|
|
||||||
text: parent.reconstructed ? MaterialIcons.check_circle : MaterialIcons.remove_circle
|
|
||||||
color: parent.reconstructed ? "#4CAF50" : "#F44336"
|
|
||||||
font.pointSize: 10
|
|
||||||
}
|
}
|
||||||
ToolTip.text: reconstructed ? "Reconstructed" : "Not Reconstructed"
|
|
||||||
ToolTip.visible: pressed
|
|
||||||
visible: inViews
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue