TASInput: Let StickWidget and IRWidget shrink
Use `sizeHint` instead of `setMinimumSize` to increase the default size
of `StickWidget` and `IRWidget`.
0531286906 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.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user