Make sure when we change main layouts we bring them to the top so all

views appear properly.
This commit is contained in:
casey langen 2016-12-10 00:06:47 -08:00
parent be9284e4ef
commit ddacf4dc69
3 changed files with 15 additions and 5 deletions

View File

@ -113,7 +113,7 @@ void LibraryLayout::ChangeMainLayout(std::shared_ptr<cursespp::LayoutBase> newLa
this->visibleLayout->SetFocusMode(ILayout::FocusModeTerminating);
if (this->IsVisible()) {
this->BringToTop();
this->visibleLayout->BringToTop();
}
this->OnLayoutChanged();

View File

@ -70,6 +70,7 @@ void MainLayout::OnLayout() {
if (this->layout) {
this->layout->MoveAndResize(0, 0, cx, cy - 1);
this->layout->Show();
this->layout->BringToTop();
if (this->shortcutsFocused) {
this->layout->SetFocus(IWindowPtr());

View File

@ -395,12 +395,21 @@ void Window::Recreate() {
}
void Window::OnParentVisibilityChanged(bool visible) {
if (!visible && this->isVisible && this->framePanel) {
this->Destroy();
if (!visible && this->isVisible) {
if (this->framePanel) {
this->Destroy();
}
this->OnVisibilityChanged(false);
}
else if (visible && this->isVisible && !this->framePanel) {
this->Recreate();
else if (visible && this->isVisible) {
if (this->framePanel) {
this->Redraw();
}
else {
this->Recreate();
}
this->OnVisibilityChanged(true);
}
}