From 78ef8523ac3c49ccce9108427895dfd49cd829ce Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 31 Jan 2016 14:56:50 -0800 Subject: [PATCH] Qt: Make key binding fields have a width relative to its height --- src/platform/qt/KeyEditor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/qt/KeyEditor.cpp b/src/platform/qt/KeyEditor.cpp index 52877bdc3..ba39b69a3 100644 --- a/src/platform/qt/KeyEditor.cpp +++ b/src/platform/qt/KeyEditor.cpp @@ -9,6 +9,7 @@ #include "GamepadButtonEvent.h" #include "ShortcutController.h" +#include #include 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; }