MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / applyIcons

Method applyIcons

pj_app/src/MainWindow.cpp:1812–1838  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1810}
1811
1812void MainWindow::applyIcons(QString theme) {
1813 // Right-side buttons (Chart + Legend in the global column, Width and
1814 // Line-style in the local panel) are created programmatically by
1815 // buildGlobalToolbar() / buildLocalToolbar() and re-tinted by their
1816 // own stylesheetChanged hooks via each button's "iconPath" property.
1817 for (const PanelToggle& toggle : panelToggles(ui_)) {
1818 // The "iconPath" property carries whichever variant (on / off) the
1819 // toggle currently shows; falls back to the on variant on first
1820 // paint before the toggle handler has run.
1821 const QString icon_path = toggle.button->property("iconPath").toString();
1822 const QString resolved = icon_path.isEmpty() ? QString::fromLatin1(toggle.icon_path_on) : icon_path;
1823 toggle.button->setIcon(loadSvg(resolved, theme));
1824 }
1825 // Title-bar menus: their QActions persist across theme changes, so
1826 // re-tint here.
1827 ui_->actionExit->setIcon(QIcon(loadSvg(":/resources/svg/logout.svg", theme)));
1828 ui_->actionMarketplace->setIcon(QIcon(loadSvg(":/resources/svg/archive.svg", theme)));
1829 if (action_preferences_ != nullptr) {
1830 action_preferences_->setIcon(QIcon(loadSvg(":/resources/svg/settings_cog_light.svg", theme)));
1831 }
1832 if (action_load_layout_ != nullptr) {
1833 action_load_layout_->setIcon(QIcon(loadSvg(":/resources/svg/dashboard_load.svg", theme)));
1834 }
1835 if (action_save_layout_ != nullptr) {
1836 action_save_layout_->setIcon(QIcon(loadSvg(":/resources/svg/save_as.svg", theme)));
1837 }
1838}
1839
1840void MainWindow::onPlotTabAdded(PlotDocker* docker) {
1841 if (docker == nullptr) {

Callers

nothing calls this directly

Calls 4

panelTogglesFunction · 0.85
toStringMethod · 0.80
isEmptyMethod · 0.45
setIconMethod · 0.45

Tested by

no test coverage detected