mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-08 16:01:42 +12:00
Qt: simplify occasions of restoreState
This commit is contained in:
parent
31101b4828
commit
bff9a06f9f
3 changed files with 5 additions and 31 deletions
|
@ -172,18 +172,12 @@ void debugger_frame::closeEvent(QCloseEvent *event)
|
|||
void debugger_frame::showEvent(QShowEvent * event)
|
||||
{
|
||||
// resize splitter widgets
|
||||
QByteArray state = xgui_settings->GetValue(gui::d_splitterState).toByteArray();
|
||||
|
||||
if (state.isEmpty()) // resize 2:1
|
||||
if (!m_splitter->restoreState(xgui_settings->GetValue(gui::d_splitterState).toByteArray()))
|
||||
{
|
||||
const int width_right = width() / 3;
|
||||
const int width_left = width() - width_right;
|
||||
m_splitter->setSizes({width_left, width_right});
|
||||
}
|
||||
else
|
||||
{
|
||||
m_splitter->restoreState(state);
|
||||
}
|
||||
|
||||
QDockWidget::showEvent(event);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue