Qt: Reduce game list jank after shutting down VM

Prevents progress bar briefly appearing, and the list scrolling to the
top when you exit a game.
This commit is contained in:
Stenzek
2024-08-03 00:50:02 +10:00
parent 3a83c4265c
commit 9a626caad9
8 changed files with 98 additions and 27 deletions

View File

@@ -16,6 +16,8 @@ class AsyncRefreshProgressCallback : public ProgressCallback
public:
AsyncRefreshProgressCallback(GameListRefreshThread* parent);
float timeSinceStart() const;
void Cancel();
void PushState() override;
@@ -33,7 +35,7 @@ private:
void fireUpdate();
GameListRefreshThread* m_parent;
Common::Timer m_last_update_time;
Common::Timer m_start_time;
QString m_status_text;
int m_last_range = 1;
int m_last_value = 0;
@@ -47,10 +49,12 @@ public:
GameListRefreshThread(bool invalidate_cache);
~GameListRefreshThread();
float timeSinceStart() const;
void cancel();
Q_SIGNALS:
void refreshProgress(const QString& status, int current, int total);
void refreshProgress(const QString& status, int current, int total, float time);
void refreshComplete();
protected: