Fix view re-creation due to visibility change.

This commit is contained in:
casey langen 2021-07-18 13:59:29 -07:00
parent 53b072f8f6
commit 825adfcf2f
2 changed files with 4 additions and 3 deletions

View File

@ -128,7 +128,6 @@ bool LyricsLayout::KeyPress(const std::string& kn) {
void LyricsLayout::OnVisibilityChanged(bool visible) {
LayoutBase::OnVisibilityChanged(visible);
if (visible) {
this->SetState(this->state);
this->LoadLyricsForCurrentTrack();
this->FocusFirst();
}

View File

@ -327,7 +327,9 @@ void Window::MoveAndResize(int x, int y, int width, int height) {
this->lastAbsoluteY = absY;
this->width = width;
this->height = height;
this->RecreateForUpdatedDimensions();
if (this->isVisibleInParent) {
this->RecreateForUpdatedDimensions();
}
}
else {
this->DestroyIfBadBounds();
@ -616,7 +618,7 @@ void Window::Show() {
}
}
else {
this->Create();
this->RecreateForUpdatedDimensions();
this->isVisibleInParent = true;
}