mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
Qt: fix initial pad settings dialog size and position
This commit is contained in:
parent
48ad7ca3a0
commit
8b3ed7b599
@ -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());
|
||||
|
@ -196,17 +196,9 @@ pad_settings_dialog::pad_settings_dialog(std::shared_ptr<gui_settings> 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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user