mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
Place current deck-editor docks before restoring saved layouts [skip ci] (#7734)
This commit is contained in:
parent
c72192fd81
commit
7768416091
1 changed files with 10 additions and 4 deletions
|
|
@ -131,10 +131,16 @@ void TabDeckEditor::loadLayout()
|
||||||
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
LayoutsSettings &layouts = SettingsCache::instance().layouts();
|
||||||
|
|
||||||
auto layoutState = layouts.getDeckEditorLayoutState();
|
auto layoutState = layouts.getDeckEditorLayoutState();
|
||||||
if (layoutState.isNull()) {
|
// Start with every current dock placed. Saved layouts from older versions
|
||||||
restartLayout();
|
// cannot describe docks introduced later; restoreState leaves those docks
|
||||||
} else {
|
// in their existing positions while restoring the saved docks, including
|
||||||
restoreState(layoutState);
|
// their visibility and floating state.
|
||||||
|
restartLayout();
|
||||||
|
if (!layoutState.isEmpty()) {
|
||||||
|
if (!restoreState(layoutState)) {
|
||||||
|
// A corrupt or incompatible state must not leave a partial layout.
|
||||||
|
restartLayout();
|
||||||
|
}
|
||||||
restoreGeometry(layouts.getDeckEditorGeometry());
|
restoreGeometry(layouts.getDeckEditorGeometry());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue