############################################################################## ######################### Theme management ################################## ##############################################################################
| 1538 | // ######################### Theme management ################################## |
| 1539 | // ############################################################################## |
| 1540 | void BarPlot::loadThemeConfig(const KConfig& config) { |
| 1541 | KConfigGroup group; |
| 1542 | if (config.hasGroup(QStringLiteral("Theme"))) |
| 1543 | group = config.group(QStringLiteral("XYCurve")); // when loading from the theme config, use the same properties as for XYCurve |
| 1544 | else |
| 1545 | group = config.group(QStringLiteral("BarPlot")); |
| 1546 | |
| 1547 | Q_D(BarPlot); |
| 1548 | const auto* plot = d->m_plot; |
| 1549 | int index = plot->curveChildIndex(this); |
| 1550 | const QColor themeColor = d->m_plot->themeColorPalette(index); |
| 1551 | |
| 1552 | d->suppressRecalc = true; |
| 1553 | |
| 1554 | for (int i = 0; i < d->dataColumns.count(); ++i) { |
| 1555 | const auto& color = plot->themeColorPalette(i); |
| 1556 | |
| 1557 | // box filling |
| 1558 | auto* background = d->backgrounds.at(i); |
| 1559 | background->loadThemeConfig(group, color); |
| 1560 | |
| 1561 | // bar border lines |
| 1562 | auto* line = d->borderLines.at(i); |
| 1563 | line->loadThemeConfig(group, color); |
| 1564 | |
| 1565 | // line |
| 1566 | if (plot->theme() == QLatin1String("Sparkline")) { |
| 1567 | if (!GuiTools::isDarkMode()) |
| 1568 | line->setColor(Qt::black); |
| 1569 | else |
| 1570 | line->setColor(Qt::white); |
| 1571 | } |
| 1572 | |
| 1573 | // error bars |
| 1574 | auto* errorBar = d->errorBars.at(i); |
| 1575 | errorBar->loadThemeConfig(group, color); |
| 1576 | } |
| 1577 | |
| 1578 | // Values |
| 1579 | d->value->loadThemeConfig(group, themeColor); |
| 1580 | |
| 1581 | d->suppressRecalc = false; |
| 1582 | d->recalcShapeAndBoundingRect(); |
| 1583 | } |
nothing calls this directly
no test coverage detected