diff options
| author | spycrab <spycrab@users.noreply.github.com> | 2019-03-04 01:29:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-04 01:29:48 +0100 |
| commit | 13b2b93d3d12e4c8491ed82c63d52a24a4849476 (patch) | |
| tree | 9b532cba4a7c132a6d3dca250cbae31b6704c56e /Source/Core | |
| parent | 66a82200117fbfdd092df890c0be318a21c30448 (diff) | |
| parent | 386accd2c8dcac873321e07fe7f5a36597b8f197 (diff) | |
Merge pull request #7846 from spycrab/qt_no_ticks
Qt/MappingButton: Don't show ticks
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp index 638a0d0ac8..6e1a2fa813 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp @@ -33,9 +33,11 @@ constexpr int SLIDER_TICK_COUNT = 100; -static QString EscapeAmpersand(QString&& string) +// Escape ampersands and remove ticks +static QString ToDisplayString(QString&& string) { - return string.replace(QStringLiteral("&"), QStringLiteral("&&")); + return string.replace(QStringLiteral("&"), QStringLiteral("&&")) + .replace(QStringLiteral("`"), QStringLiteral("")); } bool MappingButton::IsInput() const @@ -44,7 +46,7 @@ bool MappingButton::IsInput() const } MappingButton::MappingButton(MappingWidget* widget, ControlReference* ref, bool indicator) - : ElidedButton(EscapeAmpersand(QString::fromStdString(ref->GetExpression()))), m_parent(widget), + : ElidedButton(ToDisplayString(QString::fromStdString(ref->GetExpression()))), m_parent(widget), m_reference(ref) { // Force all mapping buttons to stay at a minimal height. @@ -190,7 +192,7 @@ void MappingButton::Detect() void MappingButton::OnButtonTimeout() { - setText(EscapeAmpersand(QString::fromStdString(m_reference->GetExpression()))); + setText(ToDisplayString(QString::fromStdString(m_reference->GetExpression()))); } void MappingButton::Clear() @@ -206,7 +208,7 @@ void MappingButton::Update() const auto lock = ControllerEmu::EmulatedController::GetStateLock(); m_reference->UpdateReference(g_controller_interface, m_parent->GetController()->GetDefaultDevice()); - setText(EscapeAmpersand(QString::fromStdString(m_reference->GetExpression()))); + setText(ToDisplayString(QString::fromStdString(m_reference->GetExpression()))); } void MappingButton::mouseReleaseEvent(QMouseEvent* event) |
