Qt: Hide hat number if it's 0
Vicki Pfau vi@endrift.com
Sat, 06 Mar 2021 20:09:12 -0800
1 files changed,
8 insertions(+),
4 deletions(-)
jump to
M
src/platform/qt/KeyEditor.cpp
→
src/platform/qt/KeyEditor.cpp
@@ -209,18 +209,22 @@
void KeyEditor::updateButtonText() { QStringList text; if (m_hat >= 0) { + QString hatId("%0"); + if (m_hat) { + hatId += QString::number(m_hat); + } switch (m_hatDirection) { case GamepadHatEvent::UP: - text.append(QString("↑%0").arg(m_hat)); + text.append(hatId.arg("↑")); break; case GamepadHatEvent::RIGHT: - text.append(QString("→%0").arg(m_hat)); + text.append(hatId.arg("→")); break; case GamepadHatEvent::DOWN: - text.append(QString("↓%0").arg(m_hat)); + text.append(hatId.arg("↓")); break; case GamepadHatEvent::LEFT: - text.append(QString("←%0").arg(m_hat)); + text.append(hatId.arg("←")); break; default: break;