Merge pull request #12205 from LillyJadeKatrin/retroachievements-bugfix-2

AchievementsWindow: Fix rapid popups on initial opening.
This commit is contained in:
Admiral H. Curtiss 2023-09-28 04:21:48 +02:00 committed by GitHub
commit 5b6844901f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -65,11 +65,11 @@ AchievementHeaderWidget::AchievementHeaderWidget(QWidget* parent) : QWidget(pare
m_total->addWidget(m_user_box);
m_total->addWidget(m_game_box);
UpdateData();
m_total->setContentsMargins(0, 0, 0, 0);
m_total->setAlignment(Qt::AlignTop);
setLayout(m_total);
UpdateData();
}
void AchievementHeaderWidget::UpdateData()

View File

@ -25,6 +25,8 @@ AchievementsWindow::AchievementsWindow(QWidget* parent) : QDialog(parent)
ConnectWidgets();
AchievementManager::GetInstance()->SetUpdateCallback(
[this] { QueueOnObject(this, &AchievementsWindow::UpdateData); });
UpdateData();
}
void AchievementsWindow::showEvent(QShowEvent* event)
@ -44,7 +46,6 @@ void AchievementsWindow::CreateMainLayout()
GetWrappedWidget(new AchievementSettingsWidget(m_tab_widget, this), this, 125, 100),
tr("Settings"));
m_tab_widget->addTab(GetWrappedWidget(m_progress_widget, this, 125, 100), tr("Progress"));
m_tab_widget->setTabVisible(1, AchievementManager::GetInstance()->IsGameLoaded());
m_button_box = new QDialogButtonBox(QDialogButtonBox::Close);