DolphinQt/Mapping: Replace Motion Input "WARNING: " text with a warning icon.

This commit is contained in:
Jordan Woyak 2025-05-15 10:58:43 -05:00
parent a45d00d84d
commit 17eb1b1a34
2 changed files with 16 additions and 16 deletions

View File

@ -14,6 +14,7 @@
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
#include "DolphinQt/QtUtils/QtUtils.h"
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
#include "InputCommon/InputConfig.h"
@ -32,19 +33,18 @@ void WiimoteEmuExtensionMotionInput::CreateNunchukLayout()
auto* warning_layout = new QHBoxLayout();
auto* warning_label = new QLabel(
tr("WARNING: These controls are designed to interface directly with motion "
tr("These controls are designed to interface directly with motion "
"sensor hardware. They are not intended for mapping traditional buttons, triggers or "
"axes. You might need to configure alternate input sources before using these controls."));
warning_label->setWordWrap(true);
auto* warning_input_sources_button = new QPushButton(tr("Alternate Input Sources"));
warning_layout->addWidget(warning_label, 1);
warning_layout->addWidget(warning_input_sources_button, 0, Qt::AlignRight);
warning_layout->addWidget(
QtUtils::CreateIconWarning(this, QStyle::SP_MessageBoxWarning, warning_label), 1);
warning_layout->addWidget(warning_input_sources_button);
connect(warning_input_sources_button, &QPushButton::clicked, this, [this] {
ControllerInterfaceWindow* window = new ControllerInterfaceWindow(this);
window->setAttribute(Qt::WA_DeleteOnClose, true);
window->setWindowModality(Qt::WindowModality::WindowModal);
SetQWidgetWindowDecorations(window);
window->show();
ControllerInterfaceWindow window{this};
SetQWidgetWindowDecorations(&window);
window.exec();
});
layout->addLayout(warning_layout, 0, 0, 1, -1);

View File

@ -15,6 +15,7 @@
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
#include "DolphinQt/QtUtils/QtUtils.h"
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
#include "InputCommon/InputConfig.h"
@ -29,20 +30,19 @@ void WiimoteEmuMotionControlIMU::CreateMainLayout()
{
auto* warning_layout = new QHBoxLayout();
auto* warning_label =
new QLabel(tr("WARNING: The controls under Accelerometer and Gyroscope are designed to "
new QLabel(tr("The controls under Accelerometer and Gyroscope are designed to "
"interface directly with motion sensor hardware. They are not intended for "
"mapping traditional buttons, triggers or axes. You might need to configure "
"alternate input sources before using these controls."));
warning_label->setWordWrap(true);
auto* warning_input_sources_button = new QPushButton(tr("Alternate Input Sources"));
warning_layout->addWidget(warning_label, 1);
warning_layout->addWidget(warning_input_sources_button, 0, Qt::AlignRight);
warning_layout->addWidget(
QtUtils::CreateIconWarning(this, QStyle::SP_MessageBoxWarning, warning_label), 1);
warning_layout->addWidget(warning_input_sources_button);
connect(warning_input_sources_button, &QPushButton::clicked, this, [this] {
ControllerInterfaceWindow* window = new ControllerInterfaceWindow(this);
window->setAttribute(Qt::WA_DeleteOnClose, true);
window->setWindowModality(Qt::WindowModality::WindowModal);
SetQWidgetWindowDecorations(window);
window->show();
ControllerInterfaceWindow window{this};
SetQWidgetWindowDecorations(&window);
window.exec();
});
auto* groups_layout = new QHBoxLayout();