Merge pull request #14182 from jordan-woyak/ra-hardcore-warning-size

DolphinQt: Use QtUtils::CreateIconWarning to make the RetroAchievements warning size consistent with other warnings.
This commit is contained in:
JosJuice 2025-11-30 23:25:12 +01:00 committed by GitHub
commit f842af8b03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 16 deletions

View File

@ -6,14 +6,12 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QPixmap>
#include <QPushButton>
#include <QStyle>
#include "Core/AchievementManager.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "DolphinQt/QtUtils/QtUtils.h"
#include "DolphinQt/Settings.h"
HardcoreWarningWidget::HardcoreWarningWidget(QWidget* parent) : QWidget(parent)
@ -28,25 +26,17 @@ HardcoreWarningWidget::HardcoreWarningWidget(QWidget* parent) : QWidget(parent)
void HardcoreWarningWidget::CreateWidgets()
{
const auto size = 1.5 * QFontMetrics(font()).height();
auto* const text = new QLabel(tr("Only approved codes will be applied in hardcore mode."));
auto* const icon_warning = QtUtils::CreateIconWarning(this, QStyle::SP_MessageBoxWarning, text);
QPixmap warning_icon = style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(size, size);
auto* icon = new QLabel;
icon->setPixmap(warning_icon);
m_text = new QLabel(tr("Only approved codes will be applied in hardcore mode."));
m_settings_button = new QPushButton(tr("Achievement Settings"));
auto* layout = new QHBoxLayout;
auto* const layout = new QHBoxLayout{this};
layout->addWidget(icon);
layout->addWidget(m_text, 1);
layout->addWidget(icon_warning, 1);
layout->addWidget(m_settings_button);
layout->setContentsMargins(0, 0, 0, 0);
setLayout(layout);
}
void HardcoreWarningWidget::ConnectWidgets()

View File

@ -24,7 +24,6 @@ private:
void Update();
QLabel* m_text;
QPushButton* m_settings_button;
};
#endif // USE_RETRO_ACHIEVEMENTS