diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2019-03-03 08:05:59 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2019-03-03 17:41:48 -0600 |
| commit | 1cae9b9b3929ca617ad16b72de6fd43efc8a46f7 (patch) | |
| tree | b8269bed0c9af427023684a8f19bf5c6a5a08fe8 /Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp | |
| parent | 2a3c0753303a9f4cd79a92cd94b6a22298b516d6 (diff) | |
DolphinQt: Fix ElidedButton (MappingButton) from growing with long text.
Diffstat (limited to 'Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp index 11dfe7d924..638a0d0ac8 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp @@ -32,7 +32,6 @@ #include "InputCommon/ControllerInterface/Device.h" constexpr int SLIDER_TICK_COUNT = 100; -constexpr int VERTICAL_PADDING = 2; static QString EscapeAmpersand(QString&& string) { @@ -48,18 +47,13 @@ MappingButton::MappingButton(MappingWidget* widget, ControlReference* ref, bool : ElidedButton(EscapeAmpersand(QString::fromStdString(ref->GetExpression()))), m_parent(widget), m_reference(ref) { - // Force all mapping buttons to use stay at a minimal height - int height = QFontMetrics(qApp->font()).height() + 2 * VERTICAL_PADDING; + // Force all mapping buttons to stay at a minimal height. + setFixedHeight(minimumSizeHint().height()); - setMinimumHeight(height); + // Make sure that long entries don't throw our layout out of whack. + setFixedWidth(112); - // macOS needs some wiggle room to always get round buttons - setMaximumHeight(height + 8); - - // Make sure that long entries don't throw our layout out of whack - setMaximumWidth(115); - - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); Connect(); setToolTip( |
