mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
DolphinQt/Mapping: Replace Motion Input "WARNING: " text with a warning icon.
This commit is contained in:
@ -14,6 +14,7 @@
|
|||||||
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
||||||
|
|
||||||
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
|
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
|
||||||
|
#include "DolphinQt/QtUtils/QtUtils.h"
|
||||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||||
|
|
||||||
#include "InputCommon/InputConfig.h"
|
#include "InputCommon/InputConfig.h"
|
||||||
@ -32,19 +33,18 @@ void WiimoteEmuExtensionMotionInput::CreateNunchukLayout()
|
|||||||
|
|
||||||
auto* warning_layout = new QHBoxLayout();
|
auto* warning_layout = new QHBoxLayout();
|
||||||
auto* warning_label = new QLabel(
|
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 "
|
"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."));
|
"axes. You might need to configure alternate input sources before using these controls."));
|
||||||
warning_label->setWordWrap(true);
|
warning_label->setWordWrap(true);
|
||||||
auto* warning_input_sources_button = new QPushButton(tr("Alternate Input Sources"));
|
auto* warning_input_sources_button = new QPushButton(tr("Alternate Input Sources"));
|
||||||
warning_layout->addWidget(warning_label, 1);
|
warning_layout->addWidget(
|
||||||
warning_layout->addWidget(warning_input_sources_button, 0, Qt::AlignRight);
|
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] {
|
connect(warning_input_sources_button, &QPushButton::clicked, this, [this] {
|
||||||
ControllerInterfaceWindow* window = new ControllerInterfaceWindow(this);
|
ControllerInterfaceWindow window{this};
|
||||||
window->setAttribute(Qt::WA_DeleteOnClose, true);
|
SetQWidgetWindowDecorations(&window);
|
||||||
window->setWindowModality(Qt::WindowModality::WindowModal);
|
window.exec();
|
||||||
SetQWidgetWindowDecorations(window);
|
|
||||||
window->show();
|
|
||||||
});
|
});
|
||||||
layout->addLayout(warning_layout, 0, 0, 1, -1);
|
layout->addLayout(warning_layout, 0, 0, 1, -1);
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"
|
||||||
|
|
||||||
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
|
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
|
||||||
|
#include "DolphinQt/QtUtils/QtUtils.h"
|
||||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||||
|
|
||||||
#include "InputCommon/InputConfig.h"
|
#include "InputCommon/InputConfig.h"
|
||||||
@ -29,20 +30,19 @@ void WiimoteEmuMotionControlIMU::CreateMainLayout()
|
|||||||
{
|
{
|
||||||
auto* warning_layout = new QHBoxLayout();
|
auto* warning_layout = new QHBoxLayout();
|
||||||
auto* warning_label =
|
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 "
|
"interface directly with motion sensor hardware. They are not intended for "
|
||||||
"mapping traditional buttons, triggers or axes. You might need to configure "
|
"mapping traditional buttons, triggers or axes. You might need to configure "
|
||||||
"alternate input sources before using these controls."));
|
"alternate input sources before using these controls."));
|
||||||
warning_label->setWordWrap(true);
|
warning_label->setWordWrap(true);
|
||||||
auto* warning_input_sources_button = new QPushButton(tr("Alternate Input Sources"));
|
auto* warning_input_sources_button = new QPushButton(tr("Alternate Input Sources"));
|
||||||
warning_layout->addWidget(warning_label, 1);
|
warning_layout->addWidget(
|
||||||
warning_layout->addWidget(warning_input_sources_button, 0, Qt::AlignRight);
|
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] {
|
connect(warning_input_sources_button, &QPushButton::clicked, this, [this] {
|
||||||
ControllerInterfaceWindow* window = new ControllerInterfaceWindow(this);
|
ControllerInterfaceWindow window{this};
|
||||||
window->setAttribute(Qt::WA_DeleteOnClose, true);
|
SetQWidgetWindowDecorations(&window);
|
||||||
window->setWindowModality(Qt::WindowModality::WindowModal);
|
window.exec();
|
||||||
SetQWidgetWindowDecorations(window);
|
|
||||||
window->show();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
auto* groups_layout = new QHBoxLayout();
|
auto* groups_layout = new QHBoxLayout();
|
||||||
|
Reference in New Issue
Block a user