mirror of https://github.com/mgba-emu/mgba.git
Qt: Make key binding fields have a width relative to its height
This commit is contained in:
parent
fbea708ed4
commit
78ef8523ac
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue