Skip to content

Commit

Permalink
Merge pull request #5111 from openscad/fix-initial-gui
Browse files Browse the repository at this point in the history
Fix initial GUI setup.
  • Loading branch information
t-paul committed Apr 29, 2024
2 parents d393c51 + 3741454 commit 9718493
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/gui/MainWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,6 @@ MainWindow::MainWindow(const QStringList& filenames)
const auto windowState = settings.value("window/state", QByteArray()).toByteArray();
restoreGeometry(settings.value("window/geometry", QByteArray()).toByteArray());
restoreState(windowState);
updateWindowSettings(hideConsole, hideEditor, hideCustomizer, hideErrorLog, hideEditorToolbar, hide3DViewToolbar, hideAnimate, hideViewportControl);

if (windowState.size() == 0) {
/*
Expand All @@ -681,6 +680,11 @@ MainWindow::MainWindow(const QStringList& filenames)
* fill the available space.
*/
activeEditor->setInitialSizeHint(QSize((5 * this->width() / 11), 100));
tabifyDockWidget(consoleDock, errorLogDock);
tabifyDockWidget(errorLogDock, animateDock);
showConsole();
hideCustomizer = true;
hideViewportControl = true;
} else {
#ifdef Q_OS_WIN
// Try moving the main window into the display range, this
Expand All @@ -701,6 +705,8 @@ MainWindow::MainWindow(const QStringList& filenames)
#endif // ifdef Q_OS_WIN
}

updateWindowSettings(hideConsole, hideEditor, hideCustomizer, hideErrorLog, hideEditorToolbar, hide3DViewToolbar, hideAnimate, hideViewportControl);

connect(this->editorDock, SIGNAL(topLevelChanged(bool)), this, SLOT(editorTopLevelChanged(bool)));
connect(this->consoleDock, SIGNAL(topLevelChanged(bool)), this, SLOT(consoleTopLevelChanged(bool)));
connect(this->parameterDock, SIGNAL(topLevelChanged(bool)), this, SLOT(parameterTopLevelChanged(bool)));
Expand Down Expand Up @@ -900,7 +906,7 @@ void MainWindow::loadViewSettings(){
void MainWindow::loadDesignSettings()
{
QSettingsCached settings;
if (settings.value("design/autoReload", true).toBool()) {
if (settings.value("design/autoReload", false).toBool()) {
designActionAutoReload->setChecked(true);
}
auto polySetCacheSizeMB = Preferences::inst()->getValue("advanced/polysetCacheSizeMB").toUInt();
Expand Down
7 changes: 6 additions & 1 deletion src/gui/Preferences.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ void Preferences::init() {
this->defaultmap["advanced/enableTraceUsermoduleParameters"] = true;
this->defaultmap["advanced/enableParameterCheck"] = true;
this->defaultmap["advanced/enableParameterRangeCheck"] = false;

this->defaultmap["view/hideConsole"] = false;
this->defaultmap["view/hideEditor"] = false;
this->defaultmap["view/hideErrorLog"] = false;
this->defaultmap["view/hideAnimate"] = false;
this->defaultmap["view/hideCustomizer"] = true;
this->defaultmap["view/hideViewportControl"] = true;
this->defaultmap["editor/enableAutocomplete"] = true;
this->defaultmap["editor/characterThreshold"] = 1;
this->defaultmap["editor/stepSize"] = 1;
Expand Down

0 comments on commit 9718493

Please sign in to comment.