| 592 | } |
| 593 | |
| 594 | void GradientEditorDialog::onResetToDefaultClicked() |
| 595 | { |
| 596 | const ThemeGradient factory = |
| 597 | ThemeManager::instance().factoryGradient(m_tokenName); |
| 598 | if (factory.stops.isEmpty()) return; // shouldn't happen (button disabled) |
| 599 | |
| 600 | const auto reply = QMessageBox::question(this, |
| 601 | QStringLiteral("Reset to default"), |
| 602 | QStringLiteral("Replace the current stops with the canonical " |
| 603 | "value from the bundled Default Dark theme?\n\n" |
| 604 | "Any edits made in this dialog will be discarded."), |
| 605 | QMessageBox::Yes | QMessageBox::No, QMessageBox::No); |
| 606 | if (reply != QMessageBox::Yes) return; |
| 607 | |
| 608 | m_gradient = factory; |
| 609 | if (m_angleSpin) { |
| 610 | QSignalBlocker block(m_angleSpin); |
| 611 | m_angleSpin->setValue(static_cast<int>(std::round(m_gradient.angle)) % 361); |
| 612 | } |
| 613 | syncStripAndList(); |
| 614 | if (!m_gradient.stops.isEmpty()) selectStop(0); |
| 615 | } |
| 616 | |
| 617 | void GradientEditorDialog::onEditColorBtnClicked() |
| 618 | { |
nothing calls this directly
no test coverage detected