Skip to content

Commit b15748c

Browse files
committed
enforce dockwidget workaround if all docks are spread out
logic to activate may be too simple
1 parent 245a1b4 commit b15748c

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/texstudio.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,17 @@ Texstudio::Texstudio(QWidget *parent, Qt::WindowFlags flags, QSplashScreen *spla
355355
if(Version::compareStringVersion(txsVersionConfigWritten,"4.8.0")==Version::Lower){
356356
resetDocks();
357357
}
358+
// check if dock widgets are all spread and force a reset
359+
if(checkDockSpread()){
360+
#ifdef Q_OS_MAC
361+
// on OSX only, force style to FUSION if style is MACOS (https://github.com/texstudio-org/texstudio/issues/3637)
362+
if(configManager.interfaceStyle == "macOS"){
363+
configManager.interfaceStyle = "Fusion";
364+
configManager.setInterfaceStyle();
365+
}
366+
#endif
367+
resetDocks();
368+
}
358369

359370
createStatusBar();
360371
completer = nullptr;
@@ -11643,6 +11654,20 @@ void Texstudio::updateDockVisibility(bool visible)
1164311654
dock->setProperty("isVisible",visible);
1164411655
}
1164511656
}
11657+
/*!
11658+
* \brief at start with old window set-up, all dock may be involuntarily be spread out (not tabified)
11659+
* This is checked here.
11660+
* \return true if no dock is tabified
11661+
*/
11662+
bool Texstudio::checkDockSpread()
11663+
{
11664+
QList<QDockWidget*>lst=this->findChildren<QDockWidget*>(QString(),Qt::FindDirectChildrenOnly);
11665+
QList<QDockWidget*>tabifiedWidgets;
11666+
foreach(QDockWidget* dw,lst){
11667+
tabifiedWidgets.append(tabifiedDockWidgets(dw));
11668+
}
11669+
return tabifiedWidgets.isEmpty();
11670+
}
1164611671
/*!
1164711672
\brief call updateTOC & updateStructureLocally as only one call works with a signal
1164811673
*/

src/texstudio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ public slots:
749749
void resetDocks();
750750
void toggleDockVisibility();
751751
void updateDockVisibility(bool visible);
752+
bool checkDockSpread();
752753

753754
signals:
754755
void infoNewFile(); ///< signal that a new file has been generated. Used for scritps as trigger.

0 commit comments

Comments
 (0)