MCPcopy Create free account
hub / github.com/KDE/labplot / loadThemeConfig

Method loadThemeConfig

src/backend/worksheet/plots/cartesian/Histogram.cpp:1771–1801  ·  view source on GitHub ↗

############################################################################## ######################### Theme management ################################## ##############################################################################

Source from the content-addressed store, hash-verified

1769// ######################### Theme management ##################################
1770// ##############################################################################
1771void 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
1803void Histogram::saveThemeConfig(const KConfig& config) {
1804 Q_D(const Histogram);

Callers

nothing calls this directly

Calls 7

curveChildIndexMethod · 0.80
setHistogramLineTypeMethod · 0.80
groupMethod · 0.45
themeColorPaletteMethod · 0.45
themeMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected