| 164 | } |
| 165 | |
| 166 | void StatisticsStyleControl::on_blockDataTab_currentChanged(int index) |
| 167 | { |
| 168 | auto &colorMapper = this->currentItem->colorMapper; |
| 169 | if (index == 0) |
| 170 | { |
| 171 | colorMapper.mappingType = MappingType::Predefined; |
| 172 | this->ui.comboBoxPredefined->setCurrentIndex( |
| 173 | int(stats::color::PredefinedTypeMapper.indexOf(colorMapper.predefinedType))); |
| 174 | this->ui.spinBoxPredefinedRangeMin->setValue(colorMapper.valueRange.min); |
| 175 | this->ui.spinBoxPredefinedRangeMax->setValue(colorMapper.valueRange.max); |
| 176 | } |
| 177 | else if (index == 1) |
| 178 | { |
| 179 | colorMapper.mappingType = MappingType::Gradient; |
| 180 | this->ui.frameGradientStartColor->setPlainColor( |
| 181 | functionsGui::toQColor(colorMapper.gradientColorStart)); |
| 182 | this->ui.frameGradientEndColor->setPlainColor( |
| 183 | functionsGui::toQColor(colorMapper.gradientColorEnd)); |
| 184 | this->ui.spinBoxGradientRangeMin->setValue(colorMapper.valueRange.min); |
| 185 | this->ui.spinBoxGradientRangeMax->setValue(colorMapper.valueRange.max); |
| 186 | } |
| 187 | else if (index == 2) |
| 188 | { |
| 189 | if (colorMapper.mappingType != MappingType::Map) |
| 190 | { |
| 191 | colorMapper.colorMap = convertNonMapTypeToColorMap(colorMapper); |
| 192 | } |
| 193 | colorMapper.mappingType = MappingType::Map; |
| 194 | if (auto customMapEntry = this->customColorMapStorage.indexOfColorMap( |
| 195 | colorMapper.colorMap, colorMapper.colorMapOther)) |
| 196 | this->ui.comboBoxCustomMap->setCurrentIndex(int(*customMapEntry)); |
| 197 | else |
| 198 | this->ui.comboBoxCustomMap->setCurrentIndex(-1); |
| 199 | } |
| 200 | this->ui.frameDataColor->setColorMapper(colorMapper); |
| 201 | emit StyleChanged(); |
| 202 | } |
| 203 | |
| 204 | void StatisticsStyleControl::on_comboBoxPredefined_currentIndexChanged(int index) |
| 205 | { |
no test coverage detected