Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/alicevision/meshroom.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Vital <mugulmotion@gmail.com>2022-09-29 11:45:55 +0300
committerFabien Castan <fabcastan@gmail.com>2022-10-19 11:50:18 +0300
commitc71449535d57cd8a9343038f9204f371939d0ad8 (patch)
tree7305ec0a8540a2f4743de17f0a8cad8abf41ba17
parent38b1caf647e1a74296c9201fafdd0ff3e20d88c5 (diff)
[ui] use label instead of name in outputAttribute ComboBox
-rw-r--r--meshroom/ui/qml/Viewer/Viewer2D.qml13
1 files changed, 2 insertions, 11 deletions
diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml
index dd82aecf..a7ca3547 100644
--- a/meshroom/ui/qml/Viewer/Viewer2D.qml
+++ b/meshroom/ui/qml/Viewer/Viewer2D.qml
@@ -1082,27 +1082,18 @@ FocusScope {
id: outputAttribute
clip: true
Layout.minimumWidth: 0
- Layout.preferredWidth: 3.0 * Qt.application.font.pixelSize
flat: true
property var names: []
property string name: names[currentIndex] ? names[currentIndex] : ""
- model: names
+ model: displayedNode ? names.map(n => (n == "gallery") ? "Gallery" : displayedNode.attributes.get(n).label) : []
enabled: count > 0
FontMetrics {
id: fontMetrics
}
-
- onNamesChanged: {
- // update width (set size to max name length + add margin for the dropdown icon)
- var maxWidth = 0;
- for (var i = 0; i < names.length; i++) {
- maxWidth = Math.max(maxWidth, fontMetrics.boundingRect(names[i]).width);
- }
- Layout.preferredWidth = maxWidth + 3.0 * Qt.application.font.pixelSize;
- }
+ Layout.preferredWidth: model.reduce((acc, label) => Math.max(acc, fontMetrics.boundingRect(label).width), 0) + 3.0*Qt.application.font.pixelSize
}
MaterialToolButton {