UI: Update layout on recreate to focus subviews.

This commit is contained in:
Unknown W. Brackets 2016-01-23 02:23:04 -08:00
parent f26d682e14
commit 1318f29c8d

View File

@ -36,6 +36,14 @@ void UIScreen::DoRecreateViews() {
if (persisting && root_ != nullptr) {
root_->PersistData(UI::PERSIST_RESTORE, "root", persisted);
// Update layout and refocus so things scroll into view.
// This is for resizing down, when focused on something now offscreen.
UI::LayoutViewHierarchy(*screenManager()->getUIContext(), root_);
UI::View *focused = UI::GetFocusedView();
if (focused) {
root_->SubviewFocused(focused);
}
}
}
}