From 95a77b04a6855b26d340aaca5e3030a7d1a7cb3c Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Fri, 12 Feb 2016 18:01:27 -0200 Subject: Many bugfixes related to ProjectionObserver. * Correct handling of relative metrics in UI * undo(), reset() methods added * Main class responsible for undoing and resetting both history and the observer (MUST BE AT THE SAME TIME! -- this might indicate a design issue to be addressed in the future) --- main_view.qml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'main_view.qml') diff --git a/main_view.qml b/main_view.qml index 65e1095..fd4bd4a 100644 --- a/main_view.qml +++ b/main_view.qml @@ -217,6 +217,7 @@ ApplicationWindow { Layout.alignment: Qt.AlignTop | Qt.AlignLeft GroupBox { + Layout.fillWidth: true title: "Control points" checkable: true __checkbox.onClicked: { @@ -285,6 +286,7 @@ ApplicationWindow { } GroupBox { + Layout.fillWidth: true title: "Regular points" checked: true checkable: true @@ -392,7 +394,9 @@ ApplicationWindow { GroupBox { Layout.fillWidth: true + id: metricsGroupBox title: "Projection metrics" + property RadioButton current: currentMetricRadioButton Column { ExclusiveGroup { id: wrtMetricsGroup } @@ -402,7 +406,13 @@ ApplicationWindow { text: "Current" exclusiveGroup: wrtMetricsGroup checked: true - onClicked: Main.setObserverType(Main.ObserverCurrent) + onClicked: { + if (!Main.setObserverType(Main.ObserverCurrent)) { + metricsGroupBox.current.checked = true; + } else { + metricsGroupBox.current = this; + } + } } RadioButton { id: diffPreviousMetricRadioButton @@ -410,19 +420,21 @@ ApplicationWindow { exclusiveGroup: wrtMetricsGroup onClicked: { if (!Main.setObserverType(Main.ObserverDiffPrevious)) { - this.checked = false; - currentMetricRadioButton.checked = true; + metricsGroupBox.current.checked = true; + } else { + metricsGroupBox.current = this; } } } RadioButton { - id: diffOriginalMetricRadioButton + id: diffFirstMetricRadioButton text: "Diff. to first" exclusiveGroup: wrtMetricsGroup onClicked: { if (!Main.setObserverType(Main.ObserverDiffFirst)) { - this.checked = false; - currentMetricRadioButton.checked = true; + metricsGroupBox.current.checked = true; + } else { + metricsGroupBox.current = this; } } } -- cgit v1.2.3