@@ -203,6 +203,8 @@ pad_settings_dialog::pad_settings_dialog(std::shared_ptr<gui_settings> gui_setti
203203
204204pad_settings_dialog::~pad_settings_dialog ()
205205{
206+ m_gui_settings->SetValue (gui::pads_geometry, saveGeometry ());
207+
206208 delete ui;
207209
208210 if (!Emu.IsStopped ())
@@ -219,10 +221,10 @@ void pad_settings_dialog::showEvent(QShowEvent* event)
219221 RepaintPreviewLabel (ui->preview_stick_right , ui->slider_stick_right ->value (), ui->slider_stick_right ->size ().width (), 0 , 0 , 0 , 0 );
220222
221223 // Resize in order to fit into our scroll area
222- ResizeDialog ();
223-
224- // Restrict our inner layout size. This is necessary because redrawing things will slow down the dialog otherwise.
225- ui-> mainLayout -> setSizeConstraint (QLayout::SizeConstraint::SetFixedSize);
224+ if (! restoreGeometry (m_gui_settings-> GetValue (gui::pads_geometry). toByteArray ()))
225+ {
226+ ResizeDialog ();
227+ }
226228
227229 QDialog::showEvent (event);
228230}
@@ -603,6 +605,7 @@ void pad_settings_dialog::ReactivateButtons()
603605
604606void pad_settings_dialog::RepaintPreviewLabel (QLabel* l, int deadzone, int desired_width, int x, int y, int squircle, double multiplier) const
605607{
608+ desired_width = 100 ; // Let's keep a fixed size for these labels for now
606609 const int deadzone_max = m_handler ? m_handler->thumb_max : 255 ; // 255 used as fallback. The deadzone circle shall be small.
607610
608611 constexpr qreal relative_size = 0.9 ;
@@ -1725,7 +1728,6 @@ void pad_settings_dialog::ResizeDialog()
17251728 const QSize margin_size (margins.left () + margins.right (), margins.top () + margins.bottom ());
17261729
17271730 resize (tabwidget_size + buttons_size + margin_size + spacing_size);
1728- setMaximumSize (size ());
17291731}
17301732
17311733void pad_settings_dialog::SubscribeTooltip (QObject* object, const QString& tooltip)
0 commit comments