Skip to content
Snippets Groups Projects
Commit 3b0d14b1 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Actually use stored size in splitter after restart

parent f31e2ffc
No related branches found
No related tags found
No related merge requests found
Pipeline #448 passed
......@@ -37,20 +37,22 @@ Splitter::restoreSizes(int fallback)
int savedWidth = settings.value("sidebar/width").toInt();
auto left = widget(0);
if (savedWidth == 0) {
if (savedWidth <= 0) {
hideSidebar();
return;
} else if (savedWidth == sz_.small) {
} else if (savedWidth <= sz_.small) {
if (left) {
left->setMinimumWidth(sz_.small);
left->setMaximumWidth(sz_.small);
return;
}
} else if (savedWidth < sz_.normal) {
savedWidth = sz_.normal;
}
left->setMinimumWidth(sz_.normal);
left->setMaximumWidth(2 * sz_.normal);
setSizes({sz_.normal, fallback - sz_.normal});
setSizes({savedWidth, fallback - savedWidth});
setStretchFactor(0, 0);
setStretchFactor(1, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment