############################################################################## ######################### Theme management ################################## ##############################################################################
| 1639 | // ######################### Theme management ################################## |
| 1640 | // ############################################################################## |
| 1641 | void ProcessBehaviorChart::loadThemeConfig(const KConfig& config) { |
| 1642 | KConfigGroup group; |
| 1643 | if (config.hasGroup(QStringLiteral("Theme"))) |
| 1644 | group = config.group(QStringLiteral("XYCurve")); // when loading from the theme config, use the same properties as for XYCurve |
| 1645 | else |
| 1646 | group = config.group(QStringLiteral("ProcessBehaviorChart")); |
| 1647 | |
| 1648 | Q_D(ProcessBehaviorChart); |
| 1649 | const auto* plot = d->m_plot; |
| 1650 | int index = plot->curveChildIndex(this); |
| 1651 | QColor themeColor = plot->themeColorPalette(index); |
| 1652 | |
| 1653 | d->suppressRecalc = true; |
| 1654 | |
| 1655 | d->dataCurve->line()->loadThemeConfig(group, themeColor); |
| 1656 | d->dataCurve->symbol()->loadThemeConfig(group, themeColor); |
| 1657 | |
| 1658 | themeColor = plot->themeColorPalette(index + 1); |
| 1659 | |
| 1660 | d->centerCurve->line()->loadThemeConfig(group, themeColor); |
| 1661 | d->centerCurve->symbol()->setStyle(Symbol::Style::NoSymbols); |
| 1662 | |
| 1663 | d->upperLimitCurve->line()->loadThemeConfig(group, themeColor); |
| 1664 | // d->upperLimitCurve->line()->setStyle(Qt::DashLine); TODO: crash in undo/redo |
| 1665 | d->upperLimitCurve->symbol()->setStyle(Symbol::Style::NoSymbols); |
| 1666 | |
| 1667 | d->lowerLimitCurve->line()->loadThemeConfig(group, themeColor); |
| 1668 | // d->lowerLimitCurve->line()->setStyle(Qt::DashLine); |
| 1669 | d->lowerLimitCurve->symbol()->setStyle(Symbol::Style::NoSymbols); |
| 1670 | |
| 1671 | d->centerLabel->loadThemeConfig(config); |
| 1672 | d->upperLimitLabel->loadThemeConfig(config); |
| 1673 | d->lowerLimitLabel->loadThemeConfig(config); |
| 1674 | |
| 1675 | group = config.group(QStringLiteral("CartesianPlot")); |
| 1676 | d->labelsBorderLine->loadThemeConfig(group); |
| 1677 | |
| 1678 | d->suppressRecalc = false; |
| 1679 | d->recalcShapeAndBoundingRect(); |
| 1680 | } |
| 1681 | |
| 1682 | void ProcessBehaviorChart::saveThemeConfig(const KConfig& config) { |
| 1683 | Q_D(const ProcessBehaviorChart); |
nothing calls this directly
no test coverage detected