| 1810 | } |
| 1811 | |
| 1812 | void 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 | |
| 1840 | void MainWindow::onPlotTabAdded(PlotDocker* docker) { |
| 1841 | if (docker == nullptr) { |
nothing calls this directly
no test coverage detected