all repos — mgba @ 78ef8523ac3c49ccce9108427895dfd49cd829ce

mGBA Game Boy Advance Emulator

Qt: Make key binding fields have a width relative to its height
Jeffrey Pfau jeffrey@endrift.com
Sun, 31 Jan 2016 14:56:50 -0800
commit

78ef8523ac3c49ccce9108427895dfd49cd829ce

parent

fbea708ed4c60caf748834daef1ca6b0f7f6c6b7

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/KeyEditor.cppsrc/platform/qt/KeyEditor.cpp

@@ -9,6 +9,7 @@ #include "GamepadAxisEvent.h"

#include "GamepadButtonEvent.h" #include "ShortcutController.h" +#include <QFontMetrics> #include <QKeyEvent> using namespace QGBA;

@@ -72,7 +73,8 @@ }

QSize KeyEditor::sizeHint() const { QSize hint = QLineEdit::sizeHint(); - hint.setWidth(50); + QFontMetrics fm(font()); + hint.setWidth(fm.height() * 3); return hint; }