Qt: Make key binding fields have a width relative to its height

This commit is contained in:
Jeffrey Pfau 2016-01-31 14:56:50 -08:00
parent fbea708ed4
commit 78ef8523ac
1 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,7 @@
#include "GamepadButtonEvent.h"
#include "ShortcutController.h"
#include <QFontMetrics>
#include <QKeyEvent>
using namespace QGBA;
@ -72,7 +73,8 @@ void KeyEditor::clearAxis() {
QSize KeyEditor::sizeHint() const {
QSize hint = QLineEdit::sizeHint();
hint.setWidth(50);
QFontMetrics fm(font());
hint.setWidth(fm.height() * 3);
return hint;
}