| 463 | } |
| 464 | |
| 465 | void CurveEditor::onStylesheetChanged(QString theme) { |
| 466 | current_theme_ = std::move(theme); |
| 467 | // Header chrome icons: search glyph + kebab. |
| 468 | ui_->buttonSearchCurves->setIcon(loadSvg(":/resources/svg/search_light.svg", current_theme_)); |
| 469 | ui_->buttonCurvesMenu->setIcon(loadSvg(":/resources/svg/more_vert.svg", current_theme_)); |
| 470 | // Re-tint every row's visibility + trash toggles to the new theme ink. |
| 471 | // The buttons are owned by the row widgets stored as itemWidget on each |
| 472 | // QListWidgetItem; QObject::findChildren walks that subtree. |
| 473 | for (int i = 0; i < ui_->listWidget->count(); ++i) { |
| 474 | QWidget* row = ui_->listWidget->itemWidget(ui_->listWidget->item(i)); |
| 475 | if (row == nullptr) { |
| 476 | continue; |
| 477 | } |
| 478 | for (auto* button : row->findChildren<QToolButton*>()) { |
| 479 | if (button->property(kVisibilityButtonProperty).isValid()) { |
| 480 | button->setIcon(loadSvg(button->isChecked() ? kVisibilityOnPath : kVisibilityOffPath, current_theme_)); |
| 481 | } else if (button->property(kTrashButtonProperty).isValid()) { |
| 482 | button->setIcon(loadSvg(kTrashIconPath, current_theme_)); |
| 483 | } |
| 484 | } |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | void CurveEditor::onFilterChanged(const QString& /*text*/) { |
| 489 | applyFilter(); |