diff --git a/rpcs3/rpcs3qt/debugger_frame.cpp b/rpcs3/rpcs3qt/debugger_frame.cpp index 0a5e21c308..960a144c71 100644 --- a/rpcs3/rpcs3qt/debugger_frame.cpp +++ b/rpcs3/rpcs3qt/debugger_frame.cpp @@ -232,13 +232,13 @@ bool debugger_frame::eventFilter(QObject* object, QEvent* event) return false; } -void debugger_frame::closeEvent(QCloseEvent *event) +void debugger_frame::closeEvent(QCloseEvent* event) { QDockWidget::closeEvent(event); Q_EMIT DebugFrameClosed(); } -void debugger_frame::showEvent(QShowEvent * event) +void debugger_frame::showEvent(QShowEvent* event) { // resize splitter widgets if (!m_splitter->restoreState(m_gui_settings->GetValue(gui::d_splitterState).toByteArray())) @@ -251,7 +251,7 @@ void debugger_frame::showEvent(QShowEvent * event) QDockWidget::showEvent(event); } -void debugger_frame::hideEvent(QHideEvent * event) +void debugger_frame::hideEvent(QHideEvent* event) { // save splitter state or it will resume its initial state on next show m_gui_settings->SetValue(gui::d_splitterState, m_splitter->saveState()); diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.cpp b/rpcs3/rpcs3qt/pad_settings_dialog.cpp index 4d9cd8eb87..465b217061 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/pad_settings_dialog.cpp @@ -196,17 +196,9 @@ pad_settings_dialog::pad_settings_dialog(std::shared_ptr gui_setti ui->left_stack->setCurrentIndex(0); ui->right_stack->setCurrentIndex(0); - RepaintPreviewLabel(ui->preview_stick_left, ui->slider_stick_left->value(), ui->slider_stick_left->size().width(), 0, 0, 0, 0); - RepaintPreviewLabel(ui->preview_stick_right, ui->slider_stick_right->value(), ui->slider_stick_right->size().width(), 0, 0, 0, 0); - - show(); - // Set up first tab OnTabChanged(0); ChangeProfile(ui->chooseProfile->currentText()); - - // Resize in order to fit into our scroll area - ResizeDialog(); } pad_settings_dialog::~pad_settings_dialog() @@ -221,6 +213,20 @@ pad_settings_dialog::~pad_settings_dialog() pad::set_enabled(true); } +void pad_settings_dialog::showEvent(QShowEvent* event) +{ + RepaintPreviewLabel(ui->preview_stick_left, ui->slider_stick_left->value(), ui->slider_stick_left->size().width(), 0, 0, 0, 0); + RepaintPreviewLabel(ui->preview_stick_right, ui->slider_stick_right->value(), ui->slider_stick_right->size().width(), 0, 0, 0, 0); + + // Resize in order to fit into our scroll area + ResizeDialog(); + + // Restrict our inner layout size. This is necessary because redrawing things will slow down the dialog otherwise. + ui->mainLayout->setSizeConstraint(QLayout::SizeConstraint::SetFixedSize); + + QDialog::showEvent(event); +} + void pad_settings_dialog::InitButtons() { m_pad_buttons = new QButtonGroup(this); diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.h b/rpcs3/rpcs3qt/pad_settings_dialog.h index 14e8d41872..dd6ecb208a 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.h +++ b/rpcs3/rpcs3qt/pad_settings_dialog.h @@ -204,6 +204,8 @@ private: void SubscribeTooltips(); protected: + void showEvent(QShowEvent* event) override; + /** Handle keyboard handler input */ void keyPressEvent(QKeyEvent *keyEvent) override; void mouseReleaseEvent(QMouseEvent *event) override;