From e7b49f31c7d7788be904bee6ac5450071f9f7968 Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Fri, 14 Dec 2018 16:13:52 +0100 Subject: [PATCH] [ui][GraphEditor] use 'C' locale for FloatParam validator + minor fixes * using 'C' locale to ensure floating point values can be written using '.' decimal separator * make TextField larger by default for numbers and fill width when slider is not defined * avoid binding loop on height for ListAttributes by using contentHeight as implicitHeight * add explicitly id for Connections in ComboBox --- meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml index 63431b67..2ecc1702 100644 --- a/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml +++ b/meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml @@ -184,13 +184,14 @@ RowLayout { Component { id: comboBox_component ComboBox { + id: combo enabled: root.editable model: attribute.desc.values Component.onCompleted: currentIndex = find(attribute.value) onActivated: _reconstruction.setAttribute(attribute, currentText) Connections { target: attribute - onValueChanged: currentIndex = find(attribute.value) + onValueChanged: combo.currentIndex = combo.find(attribute.value) } } } @@ -225,8 +226,10 @@ RowLayout { } DoubleValidator { id: doubleValidator + locale: 'C' // use '.' decimal separator disregarding the system locale } - implicitWidth: 70 + implicitWidth: 100 + Layout.fillWidth: !slider.active enabled: root.editable // cast value to string to avoid intrusive scientific notations on numbers property string displayValue: String(slider.active && slider.item.pressed ? slider.item.formattedValue : attribute.value) @@ -306,7 +309,7 @@ RowLayout { id: lv model: listAttribute_layout.expanded ? attribute.value : undefined visible: model != undefined && count > 0 - implicitHeight: Math.min(childrenRect.height, 300) + implicitHeight: Math.min(contentHeight, 300) Layout.fillWidth: true Layout.margins: 4 clip: true