############################################################################## ######################### Theme management ################################## ##############################################################################
| 1769 | // ######################### Theme management ################################## |
| 1770 | // ############################################################################## |
| 1771 | void Histogram::loadThemeConfig(const KConfig& config) { |
| 1772 | KConfigGroup group; |
| 1773 | if (config.hasGroup(QStringLiteral("Theme"))) |
| 1774 | group = config.group(QStringLiteral("XYCurve")); // when loading from the theme config, use the same properties as for XYCurve |
| 1775 | else |
| 1776 | group = config.group(QStringLiteral("Histogram")); |
| 1777 | |
| 1778 | Q_D(Histogram); |
| 1779 | const auto* plot = d->m_plot; |
| 1780 | int index = plot->curveChildIndex(this); |
| 1781 | const QColor themeColor = plot->themeColorPalette(index); |
| 1782 | |
| 1783 | QPen p; |
| 1784 | d->suppressRecalc = true; |
| 1785 | |
| 1786 | d->line->loadThemeConfig(group, themeColor); |
| 1787 | d->symbol->loadThemeConfig(group, themeColor); |
| 1788 | d->value->loadThemeConfig(group, themeColor); |
| 1789 | d->background->loadThemeConfig(group, themeColor); |
| 1790 | d->errorBar->loadThemeConfig(group, themeColor); |
| 1791 | |
| 1792 | if (plot->theme() == QLatin1String("Tufte")) { |
| 1793 | d->line->setHistogramLineType(Histogram::LineType::HalfBars); |
| 1794 | if (d->dataColumn && d->dataColumn->rowCount() < 100) |
| 1795 | setRugEnabled(true); |
| 1796 | } else |
| 1797 | setRugEnabled(false); |
| 1798 | |
| 1799 | d->suppressRecalc = false; |
| 1800 | d->recalcShapeAndBoundingRect(); |
| 1801 | } |
| 1802 | |
| 1803 | void Histogram::saveThemeConfig(const KConfig& config) { |
| 1804 | Q_D(const Histogram); |
nothing calls this directly
no test coverage detected