MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / onResetToDefaultClicked

Method onResetToDefaultClicked

src/gui/GradientEditorDialog.cpp:594–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

592}
593
594void 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
617void GradientEditorDialog::onEditColorBtnClicked()
618{

Callers

nothing calls this directly

Calls 3

factoryGradientMethod · 0.80
isEmptyMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected