FancyMainWindow: Remove auto-hide title bars functionality

This added complexity with the hovering to get the title bars shown, and
discoverability issues with the action in the views menu to show all
title bars, and the issue that some docks then had double titles,
because we wanted some title to be shown even if the title bar is
hidden.

Instead only show the dock control buttons only on hover, which already
removes a lot visual clutter that was the main reason for the
whole exercise.

One issue is that the title is now uselessly repeated for tabbed docks.
Another is that the title bar style is ugly and not very compatible to
what we otherwise have.

Change-Id: Ib093e0a3f2f07ece74b9055015c5523994032c5a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Eike Ziller
2023-10-31 10:22:15 +01:00
parent f84e3074cd
commit d2500dc77b
7 changed files with 39 additions and 180 deletions

View File

@@ -502,7 +502,6 @@ EditorWidget::EditorWidget(const QSharedPointer<JsonSettingsDocument> &document,
, m_actionHandler(actionHandler)
{
setContextMenuPolicy(Qt::NoContextMenu);
setAutoHideTitleBars(false);
setDockNestingEnabled(true);
setDocumentMode(true);
setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::TabPosition::South);
@@ -541,13 +540,12 @@ void EditorWidget::focusInEvent(QFocusEvent *event)
void EditorWidget::addCompiler(const std::shared_ptr<SourceSettings> &sourceSettings,
const std::shared_ptr<CompilerSettings> &compilerSettings,
int idx,
QDockWidget *parentDockWidget)
int idx)
{
auto compiler = new CompilerWidget(sourceSettings, compilerSettings, m_undoStack);
compiler->setWindowTitle("Compiler #" + QString::number(idx));
compiler->setObjectName("compiler_" + QString::number(idx));
QDockWidget *dockWidget = addDockForWidget(compiler, parentDockWidget);
QDockWidget *dockWidget = addDockForWidget(compiler);
dockWidget->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable);
addDockWidget(Qt::RightDockWidgetArea, dockWidget);
m_compilerWidgets.append(dockWidget);
@@ -607,18 +605,15 @@ void EditorWidget::addSourceEditor(const std::shared_ptr<SourceSettings> &source
addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
sourceSettings->compilers.forEachItem<CompilerSettings>(
[this, sourceSettings, dockWidget](const std::shared_ptr<CompilerSettings> &compilerSettings,
int idx) {
addCompiler(sourceSettings, compilerSettings, idx + 1, dockWidget);
[this, sourceSettings](const std::shared_ptr<CompilerSettings> &compilerSettings, int idx) {
addCompiler(sourceSettings, compilerSettings, idx + 1);
});
sourceSettings->compilers.setItemAddedCallback<CompilerSettings>(
[this, sourceSettings, dockWidget](
const std::shared_ptr<CompilerSettings> &compilerSettings) {
[this, sourceSettings](const std::shared_ptr<CompilerSettings> &compilerSettings) {
addCompiler(sourceSettings->shared_from_this(),
compilerSettings,
sourceSettings->compilers.size(),
dockWidget);
sourceSettings->compilers.size());
});
sourceSettings->compilers.setItemRemovedCallback<CompilerSettings>(