From df37617975096cf6015a4feecb3fdaac4ef88070 Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Fri, 3 Apr 2026 11:28:00 -0700 Subject: [PATCH] TASInput: Let StickWidget and IRWidget shrink Use `sizeHint` instead of `setMinimumSize` to increase the default size of `StickWidget` and `IRWidget`. 0531286906ec65edf3736813517496c95bf87ada doubled the initial sizes of `StickWidget` and `IRWidget`, but using `setMinimumSize` to do so prevented users from shrinking the widgets manually. Resolves bugs.dolphin-emu.org/issues/14019. --- Source/Core/DolphinQt/TAS/IRWidget.cpp | 7 ++++++- Source/Core/DolphinQt/TAS/IRWidget.h | 2 ++ Source/Core/DolphinQt/TAS/StickWidget.cpp | 7 ++++++- Source/Core/DolphinQt/TAS/StickWidget.h | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/TAS/IRWidget.cpp b/Source/Core/DolphinQt/TAS/IRWidget.cpp index f0dd5f766c..0b08da1a40 100644 --- a/Source/Core/DolphinQt/TAS/IRWidget.cpp +++ b/Source/Core/DolphinQt/TAS/IRWidget.cpp @@ -20,7 +20,12 @@ IRWidget::IRWidget(QWidget* parent) : QWidget(parent) "Right click to re-center it.")); // If the widget gets too small, it will get deformed. - setMinimumSize(QSize(128, 96)); + setMinimumSize(QSize(64, 48)); +} + +QSize IRWidget::sizeHint() const +{ + return QSize(128, 96); } void IRWidget::SetX(u16 x) diff --git a/Source/Core/DolphinQt/TAS/IRWidget.h b/Source/Core/DolphinQt/TAS/IRWidget.h index f5fc5a9dc5..a709582b1e 100644 --- a/Source/Core/DolphinQt/TAS/IRWidget.h +++ b/Source/Core/DolphinQt/TAS/IRWidget.h @@ -13,6 +13,8 @@ class IRWidget : public QWidget public: explicit IRWidget(QWidget* parent); + QSize sizeHint() const override; + static constexpr u16 IR_MIN_X = 0; static constexpr u16 IR_MIN_Y = 0; static constexpr u16 IR_MAX_X = 1023; diff --git a/Source/Core/DolphinQt/TAS/StickWidget.cpp b/Source/Core/DolphinQt/TAS/StickWidget.cpp index 85e6671df0..3dbfb423bc 100644 --- a/Source/Core/DolphinQt/TAS/StickWidget.cpp +++ b/Source/Core/DolphinQt/TAS/StickWidget.cpp @@ -21,7 +21,12 @@ StickWidget::StickWidget(QWidget* parent, u16 max_x, u16 max_y) "Right click to re-center it.")); // If the widget gets too small, it will get deformed. - setMinimumSize(QSize(128, 128)); + setMinimumSize(QSize(64, 64)); +} + +QSize StickWidget::sizeHint() const +{ + return QSize(128, 128); } void StickWidget::SetX(u16 x) diff --git a/Source/Core/DolphinQt/TAS/StickWidget.h b/Source/Core/DolphinQt/TAS/StickWidget.h index 46fd399b92..20b1e36b6d 100644 --- a/Source/Core/DolphinQt/TAS/StickWidget.h +++ b/Source/Core/DolphinQt/TAS/StickWidget.h @@ -13,6 +13,8 @@ class StickWidget : public QWidget public: explicit StickWidget(QWidget* parent, u16 width, u16 height); + QSize sizeHint() const override; + signals: void ChangedX(u16 x); void ChangedY(u16 y);