Skip to content

Commit

Permalink
RMG: don't switch to rom browser widget when rom searcher was canceled
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Aug 28, 2023
1 parent 697b358 commit d0928b5
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Source/RMG/UserInterface/Widget/RomBrowser/RomBrowserWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void RomBrowserWidget::ShowList(void)
if (!this->IsRefreshingRomList() &&
this->currentWidget() != this->emptyWidget)
{
this->setCurrentWidget(this->listViewWidget);
this->setCurrentWidget(this->listViewWidget);
}
}

Expand All @@ -310,7 +310,7 @@ void RomBrowserWidget::ShowGrid(void)
if (!this->IsRefreshingRomList() &&
this->currentWidget() != this->emptyWidget)
{
this->setCurrentWidget(this->gridViewWidget);
this->setCurrentWidget(this->gridViewWidget);
}
}

Expand Down Expand Up @@ -847,13 +847,19 @@ void RomBrowserWidget::on_RomBrowserThread_Finished(bool canceled)
}
}

if (!canceled)
// when canceled, we shouldn't switch to the grid/list view
// because that can cause some flicker, so just return here
// and don't do anything because a refresh will be triggered
// later on anyways
if (canceled)
{
if (this->listViewModel->rowCount() == 0)
{
this->setCurrentWidget(this->emptyWidget);
return;
}
return;
}

if (this->listViewModel->rowCount() == 0)
{
this->setCurrentWidget(this->emptyWidget);
return;
}

// prevent flicker by forcing the loading screen
Expand Down

0 comments on commit d0928b5

Please sign in to comment.