From f696b0b022aa9ce6103313258283b1daddee1848 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Fri, 13 Oct 2023 11:58:03 +0100 Subject: [PATCH] Disable scaling options appropriately wrt selected averaging option --- .../plugins/correlation/ui/qml/CorrelationPlugin.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/plugins/correlation/ui/qml/CorrelationPlugin.qml b/source/plugins/correlation/ui/qml/CorrelationPlugin.qml index a16578d97..7dcb5c990 100644 --- a/source/plugins/correlation/ui/qml/CorrelationPlugin.qml +++ b/source/plugins/correlation/ui/qml/CorrelationPlugin.qml @@ -233,7 +233,7 @@ PluginContent { id: meanCentreScaling text: qsTr("Mean Centre Scaling") - enabled: !plot.iqrStyle + enabled: plot.complexScalingEnabled checkable: true checked: plot.scaleType === PlotScaleType.MeanCentre onTriggered: { plot.scaleType = PlotScaleType.MeanCentre; } @@ -243,7 +243,7 @@ PluginContent { id: unitVarianceScaling text: qsTr("Unit Variance Scaling") - enabled: !plot.iqrStyle + enabled: plot.complexScalingEnabled checkable: true checked: plot.scaleType === PlotScaleType.UnitVariance onTriggered: { plot.scaleType = PlotScaleType.UnitVariance; } @@ -253,7 +253,7 @@ PluginContent { id: paretoScaling text: qsTr("Pareto Scaling") - enabled: !plot.iqrStyle + enabled: plot.complexScalingEnabled checkable: true checked: plot.scaleType === PlotScaleType.Pareto onTriggered: { plot.scaleType = PlotScaleType.Pareto; } @@ -623,13 +623,11 @@ PluginContent MenuUtils.addActionTo(scalingMenu, meanCentreScaling); MenuUtils.addActionTo(scalingMenu, unitVarianceScaling); MenuUtils.addActionTo(scalingMenu, paretoScaling); - scalingMenu.enabled = Qt.binding(() => - plot.averagingType === PlotAveragingType.Individual || plot.iqrStyle); MenuUtils.addSeparatorTo(scalingMenu); let scaleByAttributeMenu = MenuUtils.addSubMenuTo(scalingMenu, qsTr("By Attribute")); - scaleByAttributeMenu.enabled = Qt.binding(() => !plot.iqrStyle); + scaleByAttributeMenu.enabled = Qt.binding(() => plot.complexScalingEnabled); plugin.model.numericalAttributeNames.forEach(function(attributeName) { let attributeMenuItem = MenuUtils.addItemTo(scaleByAttributeMenu, attributeName); @@ -1069,6 +1067,8 @@ PluginContent property bool iqrStyle: plot.groupByAnnotation || plot.averagingType === PlotAveragingType.IQR onIqrStyleChanged: { updateMenu(); } + property bool complexScalingEnabled: plot.averagingType === PlotAveragingType.Individual + horizontalScrollPosition: horizontalPlotScrollBar.position / (1.0 - horizontalPlotScrollBar.size) property var _lastSelectedRowsOfInterest: []