mirror of https://github.com/RPCS3/rpcs3.git
Qt: store pad settings state and remove max size
This commit is contained in:
parent
af95ff5f8b
commit
42aa8f263a
|
@ -245,6 +245,7 @@ namespace gui
|
||||||
const gui_save loc_language = gui_save(localization, "language", "en");
|
const gui_save loc_language = gui_save(localization, "language", "en");
|
||||||
|
|
||||||
const gui_save pads_show_emulated = gui_save(pad_settings, "show_emulated_values", false);
|
const gui_save pads_show_emulated = gui_save(pad_settings, "show_emulated_values", false);
|
||||||
|
const gui_save pads_geometry = gui_save(pad_settings, "geometry", QByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Class for GUI settings..
|
/** Class for GUI settings..
|
||||||
|
|
|
@ -203,6 +203,8 @@ pad_settings_dialog::pad_settings_dialog(std::shared_ptr<gui_settings> gui_setti
|
||||||
|
|
||||||
pad_settings_dialog::~pad_settings_dialog()
|
pad_settings_dialog::~pad_settings_dialog()
|
||||||
{
|
{
|
||||||
|
m_gui_settings->SetValue(gui::pads_geometry, saveGeometry());
|
||||||
|
|
||||||
delete ui;
|
delete ui;
|
||||||
|
|
||||||
if (!Emu.IsStopped())
|
if (!Emu.IsStopped())
|
||||||
|
@ -219,10 +221,10 @@ void pad_settings_dialog::showEvent(QShowEvent* event)
|
||||||
RepaintPreviewLabel(ui->preview_stick_right, ui->slider_stick_right->value(), ui->slider_stick_right->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
|
// Resize in order to fit into our scroll area
|
||||||
ResizeDialog();
|
if (!restoreGeometry(m_gui_settings->GetValue(gui::pads_geometry).toByteArray()))
|
||||||
|
{
|
||||||
// Restrict our inner layout size. This is necessary because redrawing things will slow down the dialog otherwise.
|
ResizeDialog();
|
||||||
ui->mainLayout->setSizeConstraint(QLayout::SizeConstraint::SetFixedSize);
|
}
|
||||||
|
|
||||||
QDialog::showEvent(event);
|
QDialog::showEvent(event);
|
||||||
}
|
}
|
||||||
|
@ -603,6 +605,7 @@ void pad_settings_dialog::ReactivateButtons()
|
||||||
|
|
||||||
void pad_settings_dialog::RepaintPreviewLabel(QLabel* l, int deadzone, int desired_width, int x, int y, int squircle, double multiplier) const
|
void pad_settings_dialog::RepaintPreviewLabel(QLabel* l, int deadzone, int desired_width, int x, int y, int squircle, double multiplier) const
|
||||||
{
|
{
|
||||||
|
desired_width = 100; // Let's keep a fixed size for these labels for now
|
||||||
const int deadzone_max = m_handler ? m_handler->thumb_max : 255; // 255 used as fallback. The deadzone circle shall be small.
|
const int deadzone_max = m_handler ? m_handler->thumb_max : 255; // 255 used as fallback. The deadzone circle shall be small.
|
||||||
|
|
||||||
constexpr qreal relative_size = 0.9;
|
constexpr qreal relative_size = 0.9;
|
||||||
|
@ -1725,7 +1728,6 @@ void pad_settings_dialog::ResizeDialog()
|
||||||
const QSize margin_size(margins.left() + margins.right(), margins.top() + margins.bottom());
|
const QSize margin_size(margins.left() + margins.right(), margins.top() + margins.bottom());
|
||||||
|
|
||||||
resize(tabwidget_size + buttons_size + margin_size + spacing_size);
|
resize(tabwidget_size + buttons_size + margin_size + spacing_size);
|
||||||
setMaximumSize(size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pad_settings_dialog::SubscribeTooltip(QObject* object, const QString& tooltip)
|
void pad_settings_dialog::SubscribeTooltip(QObject* object, const QString& tooltip)
|
||||||
|
|
|
@ -2342,6 +2342,9 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -2360,6 +2363,9 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
Loading…
Reference in New Issue