| 638 | } |
| 639 | |
| 640 | void TokenEditorWidget::refreshResetButton() |
| 641 | { |
| 642 | if (m_currentToken.isEmpty()) { |
| 643 | m_resetBtn->setEnabled(false); |
| 644 | return; |
| 645 | } |
| 646 | auto& tm = ThemeManager::instance(); |
| 647 | if (m_activeContainerPath.isEmpty()) { |
| 648 | // Root scope: Reset loads the bundled factory value into the |
| 649 | // edit buffer for the user to confirm via OK. Only useful |
| 650 | // when there's a factory value to fall back to. |
| 651 | m_resetBtn->setEnabled(tm.hasFactoryValue(m_currentToken)); |
| 652 | } else { |
| 653 | // Nested scope: Reset means "clear my override here" — useful |
| 654 | // only when there IS an override at this scope to clear. |
| 655 | // Mirrors right-click → Clear Override on the scope-chain |
| 656 | // column, so the button's enable state matches that semantic. |
| 657 | m_resetBtn->setEnabled( |
| 658 | tm.isOverriddenAt(m_activeContainerPath, m_currentToken)); |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | // ───────────────────────────────────────────────────────── markDirty ───── |
| 663 |
nothing calls this directly
no test coverage detected