mirror of https://github.com/mgba-emu/mgba.git
Qt: Hide hat number if it's 0
This commit is contained in:
parent
b20739093f
commit
bd9fdc5025
|
@ -209,18 +209,22 @@ bool KeyEditor::event(QEvent* event) {
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue