##// END OF EJS Templates
Call the calculation of the thresholds in the scale editor (with each click on the 'automatic' mode)
Alexandre Leroux -
r1021:b014e09f2329
parent child
Show More
@@ -151,6 +151,16 void ColorScaleEditor::onThresholdChanged(bool checked)
151
151
152 ui->minSpinBox->setEnabled(!isAutomatic);
152 ui->minSpinBox->setEnabled(!isAutomatic);
153 ui->maxSpinBox->setEnabled(!isAutomatic);
153 ui->maxSpinBox->setEnabled(!isAutomatic);
154
155 // Computes automatic thresholds
156 if (isAutomatic) {
157 double minThreshold, maxThreshold;
158 std::tie(minThreshold, maxThreshold) = SqpColorScale::computeThresholds(m_Scale);
159 ui->minSpinBox->setValue(minThreshold);
160 ui->maxSpinBox->setValue(maxThreshold);
161
162 updatePreview();
163 }
154 }
164 }
155 }
165 }
156
166
@@ -34,9 +34,6
34 <property name="text">
34 <property name="text">
35 <string>OK</string>
35 <string>OK</string>
36 </property>
36 </property>
37 <property name="default">
38 <bool>true</bool>
39 </property>
40 </widget>
37 </widget>
41 </item>
38 </item>
42 <item>
39 <item>
@@ -71,9 +68,6
71 </item>
68 </item>
72 <item row="1" column="1">
69 <item row="1" column="1">
73 <widget class="QRadioButton" name="thresholdAutoButton">
70 <widget class="QRadioButton" name="thresholdAutoButton">
74 <property name="enabled">
75 <bool>false</bool>
76 </property>
77 <property name="text">
71 <property name="text">
78 <string>Automatic</string>
72 <string>Automatic</string>
79 </property>
73 </property>
@@ -158,10 +152,10
158 <tabstops>
152 <tabstops>
159 <tabstop>gradientComboBox</tabstop>
153 <tabstop>gradientComboBox</tabstop>
160 <tabstop>thresholdAutoButton</tabstop>
154 <tabstop>thresholdAutoButton</tabstop>
161 <tabstop>okButton</tabstop>
162 <tabstop>thresholdManualButton</tabstop>
155 <tabstop>thresholdManualButton</tabstop>
163 <tabstop>maxSpinBox</tabstop>
164 <tabstop>minSpinBox</tabstop>
156 <tabstop>minSpinBox</tabstop>
157 <tabstop>maxSpinBox</tabstop>
158 <tabstop>okButton</tabstop>
165 <tabstop>cancelButton</tabstop>
159 <tabstop>cancelButton</tabstop>
166 </tabstops>
160 </tabstops>
167 <resources/>
161 <resources/>
General Comments 0
You need to be logged in to leave comments. Login now