summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2025-11-27 01:43:50 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2025-11-27 01:43:50 -0600
commit70d4bb970c55f593db049beac86e0a8794b29e8b (patch)
tree5de052ec16fd8d28749f0cfce89a1faf58de8452 /Source/Core
parentc935f712e744520c2ea3875f2fce9cef8d75316b (diff)
DolphinQt: Use QtUtils::CreateIconWarning to make the RetroAchievements "hardcore mode" warning size consistent with the other warnings.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/Config/HardcoreWarningWidget.cpp20
-rw-r--r--Source/Core/DolphinQt/Config/HardcoreWarningWidget.h1
2 files changed, 5 insertions, 16 deletions
diff --git a/Source/Core/DolphinQt/Config/HardcoreWarningWidget.cpp b/Source/Core/DolphinQt/Config/HardcoreWarningWidget.cpp
index 257a43c366..2244aa6a0b 100644
--- a/Source/Core/DolphinQt/Config/HardcoreWarningWidget.cpp
+++ b/Source/Core/DolphinQt/Config/HardcoreWarningWidget.cpp
@@ -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()
diff --git a/Source/Core/DolphinQt/Config/HardcoreWarningWidget.h b/Source/Core/DolphinQt/Config/HardcoreWarningWidget.h
index c4a20eba96..4b7db7f675 100644
--- a/Source/Core/DolphinQt/Config/HardcoreWarningWidget.h
+++ b/Source/Core/DolphinQt/Config/HardcoreWarningWidget.h
@@ -24,7 +24,6 @@ private:
void Update();
- QLabel* m_text;
QPushButton* m_settings_button;
};
#endif // USE_RETRO_ACHIEVEMENTS