| 146 | p->OnReshown(*this); |
| 147 | RefreshTitle(); |
| 148 | } |
| 149 | |
| 150 | void OptionsShell::PopPage() |
| 151 | { |
| 152 | if (m_stack.empty()) |
| 153 | { |
| 154 | BeginCloseAnim(IDC_CANCEL); |
| 155 | return; |
| 156 | } |
| 157 | auto top = std::move(m_stack.back()); |
| 158 | m_stack.pop_back(); |
| 159 | top->Unmount(*this); |
| 160 | top.reset(); |
| 161 | |
| 162 | // PushPage hides the previous page's controls in all cases (modal |
| 163 | // or not — see comment there). Symmetric re-show on pop. |
| 164 | if (auto* now = TopPage()) |
| 165 | { |
| 166 | ShowPageControls(now, true); |
| 167 | // Default focus first, OnReshown last — the latter is the place |
| 168 | // pages override focus to remember per-page state (e.g. |
| 169 | // FlatMenuPage's last-nav-idc memory). Without this order the |
| 170 | // default would trample the remembered focus. |
| 171 | int focusIdc = now->DefaultFocusIdc(); |
| 172 | if (focusIdc >= 0) |
| 173 | FocusNotebookCtrl(focusIdc); |
| 174 | now->OnReshown(*this); |
| 175 | RefreshTitle(); |
| 176 | } |
| 177 | else |
| 178 | { |
| 179 | BeginCloseAnim(IDC_CANCEL); |
| 180 | } |
| 181 | } |
| 182 |
no test coverage detected