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
1 files changed,
3 insertions(+),
1 deletions(-)
jump to
M
src/platform/qt/KeyEditor.cpp
→
src/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; }