############################################################################## ######################### Theme management ################################## ##############################################################################
| 1106 | // ######################### Theme management ################################## |
| 1107 | // ############################################################################## |
| 1108 | void LollipopPlot::loadThemeConfig(const KConfig& config) { |
| 1109 | KConfigGroup group; |
| 1110 | if (config.hasGroup(QStringLiteral("Theme"))) |
| 1111 | group = config.group(QStringLiteral("XYCurve")); // when loading from the theme config, use the same properties as for XYCurve |
| 1112 | else |
| 1113 | group = config.group(QStringLiteral("LollipopPlot")); |
| 1114 | |
| 1115 | Q_D(LollipopPlot); |
| 1116 | const auto* plot = d->m_plot; |
| 1117 | int index = plot->curveChildIndex(this); |
| 1118 | const QColor themeColor = plot->themeColorPalette(index); |
| 1119 | |
| 1120 | d->suppressRecalc = true; |
| 1121 | |
| 1122 | for (int i = 0; i < d->dataColumns.count(); ++i) { |
| 1123 | const auto& color = plot->themeColorPalette(i); |
| 1124 | |
| 1125 | // lines |
| 1126 | auto* line = d->lines.at(i); |
| 1127 | line->loadThemeConfig(group, color); |
| 1128 | |
| 1129 | // symbols |
| 1130 | auto* symbol = d->symbols.at(i); |
| 1131 | symbol->loadThemeConfig(group, color); |
| 1132 | } |
| 1133 | |
| 1134 | // values |
| 1135 | d->value->loadThemeConfig(group, themeColor); |
| 1136 | |
| 1137 | d->suppressRecalc = false; |
| 1138 | d->recalcShapeAndBoundingRect(); |
| 1139 | } |
nothing calls this directly
no test coverage detected