mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 01:23:24 -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();
|
||||
|
||||
auto layoutState = layouts.getDeckEditorLayoutState();
|
||||
if (layoutState.isNull()) {
|
||||
// Start with every current dock placed. Saved layouts from older versions
|
||||
// cannot describe docks introduced later; restoreState leaves those docks
|
||||
// in their existing positions while restoring the saved docks, including
|
||||
// their visibility and floating state.
|
||||
restartLayout();
|
||||
} else {
|
||||
restoreState(layoutState);
|
||||
if (!layoutState.isEmpty()) {
|
||||
if (!restoreState(layoutState)) {
|
||||
// A corrupt or incompatible state must not leave a partial layout.
|
||||
restartLayout();
|
||||
}
|
||||
restoreGeometry(layouts.getDeckEditorGeometry());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue