Open the last selected tab on restart
This commit is contained in:
@@ -186,6 +186,11 @@ void WindowManager::initialize()
|
||||
tab->getTab()->useDefaultTitle = false;
|
||||
}
|
||||
|
||||
// selected
|
||||
if (tab_obj.value("selected").toBool(false)) {
|
||||
window.getNotebook().select(tab);
|
||||
}
|
||||
|
||||
// load splits
|
||||
int colNr = 0;
|
||||
for (QJsonValue column_val : tab_obj.value("splits").toArray()) {
|
||||
@@ -251,6 +256,11 @@ void WindowManager::save()
|
||||
tab_obj.insert("title", tab->getTab()->getTitle());
|
||||
}
|
||||
|
||||
// selected
|
||||
if (window->getNotebook().getSelectedPage() == tab) {
|
||||
tab_obj.insert("selected", true);
|
||||
}
|
||||
|
||||
// splits
|
||||
QJsonArray columns_arr;
|
||||
std::vector<std::vector<widgets::Split *>> columns = tab->getColumns();
|
||||
|
||||
Reference in New Issue
Block a user