Index: sources/gui/qml/dialogs/headerbar/InformationDialog.qml =================================================================== diff -u -r96461222b811e278e7b3ca90ba284fb3f62a2ffe -rdedda6dd689358d62662b514fb6d14156c4eaaee --- sources/gui/qml/dialogs/headerbar/InformationDialog.qml (.../InformationDialog.qml) (revision 96461222b811e278e7b3ca90ba284fb3f62a2ffe) +++ sources/gui/qml/dialogs/headerbar/InformationDialog.qml (.../InformationDialog.qml) (revision dedda6dd689358d62662b514fb6d14156c4eaaee) @@ -4,9 +4,12 @@ import "qrc:/globals" HeaderBarPopup { id: _root - padding : Variables.defaultMargin * 2 + readonly property string qrCodeURL : "www.diality.com/moda-flx" + readonly property int rightColumnWidth : 325 + readonly property int leftColumnWidth : 170 + readonly property int columnSpacing : Variables.defaultMargin * 3 - property var _dataModel: [ + readonly property var _dataModel: [ { name: qsTr("OS Version" ) , value: vDevice.osVersion }, { name: qsTr("UI Version" ) , value: Qt.application.version }, { name: qsTr("TD Version" ) , value: vAdjustmentVersions.tdVerDevice }, @@ -15,47 +18,21 @@ { name: qsTr("DD Version" ) , value: vAdjustmentVersions.ddVerDevice }, { name: qsTr("DD FPGA Version" ) , value: vAdjustmentVersions.ddVerFPGA }, { name: qsTr("DD Serial Number" ) , value: vAdjustmentVersions.ddSerial }, - { name: qsTr("FP Version" ) , value: "" }, // TODO fix me - { name: qsTr("FP FPGA Version" ) , value: "" } + { name: qsTr("FP Version" ) , value: "" }, // TODO NR: add me + { name: qsTr("FP FPGA Version" ) , value: "" } // TODO NR: add me ] - property int _rightColumnWidth : 0 - property int _leftColumnWidth : 0 - property int _columnSpacing : Variables.defaultMargin * 2 + padding : Variables.defaultMargin * 2 - TextMetrics { id: textMetrics - font.pixelSize: Fonts.fontPixelDialogText - } + Component.onCompleted: { _qrCode.qrcode = qrCodeURL } - Component.onCompleted: { - _qrCode.qrcode ="www.diality.com/moda-flx" - - Qt.callLater(function() { - var max = 0 - for (var i = 0; i < _dataModel.length; ++i) { - textMetrics.text = _dataModel[i].value - max = Math.max(max, textMetrics.width) - } - _rightColumnWidth = max - }) - - Qt.callLater(function() { - var max = 0 - for (var i = 0; i < _dataModel.length; ++i) { - textMetrics.text = _dataModel[i].name - max = Math.max(max, textMetrics.width) - } - _leftColumnWidth = max - }) - } - contentItem: Column { id: _contentColumn anchors.centerIn : parent spacing : Variables.defaultMargin * 2 Item { id: _versionList - width : _rightColumnWidth + _leftColumnWidth + _columnSpacing - height : _versionColumn.implicitHeight + width : rightColumnWidth + leftColumnWidth + columnSpacing + height : _versionColumn.implicitHeight Column { id: _versionColumn anchors.fill: parent @@ -68,14 +45,14 @@ height : 40 Row { id: _row - spacing : _columnSpacing + spacing : columnSpacing width : _versionColumn.width anchors.verticalCenter: parent.verticalCenter Text { id: _name color : "#2E5E92" text : modelData.name - width : _leftColumnWidth + width : leftColumnWidth font.pixelSize : Fonts.fontPixelDialogText font.weight : Font.Medium horizontalAlignment : Text.AlignLeft @@ -84,10 +61,11 @@ Text { id: _value color : "grey" text : modelData.value - width : _rightColumnWidth + width : rightColumnWidth font.pixelSize : 20 horizontalAlignment : Text.AlignRight verticalAlignment : Text.AlignVCenter + elide : Text.ElideRight } }