Allow to set a custom title for all FloatingContainer (#454)

This commit is contained in:
tytan652
2022-10-20 19:35:31 +00:00
committed by GitHub
parent 6444e7424f
commit 537828ef3d
4 changed files with 50 additions and 5 deletions

View File

@@ -433,7 +433,7 @@ struct FloatingDockContainerPrivate
}
else
{
setWindowTitle(qApp->applicationDisplayName());
setWindowTitle(floatingContainersTitle());
}
// reflect CurrentWidget's icon if configured to do so, otherwise display application icon as window icon
@@ -453,6 +453,18 @@ struct FloatingDockContainerPrivate
* Handles escape key press when dragging around the floating widget
*/
void handleEscapeKey();
/**
* Returns the title used by all FloatingContainer that does not
* reflect the title of the current dock widget.
*
* If not title was set with CDockManager::setFloatingContainersTitle(),
* it returns QGuiApplication::applicationDisplayName().
*/
static QString floatingContainersTitle()
{
return CDockManager::floatingContainersTitle();
}
};
// struct FloatingDockContainerPrivate
@@ -985,7 +997,7 @@ void CFloatingDockContainer::onDockAreasAddedOrRemoved()
SLOT(onDockAreaCurrentChanged(int)));
d->SingleDockArea = nullptr;
}
d->setWindowTitle(qApp->applicationDisplayName());
d->setWindowTitle(d->floatingContainersTitle());
setWindowIcon(QApplication::windowIcon());
}
}
@@ -1012,7 +1024,7 @@ void CFloatingDockContainer::updateWindowTitle()
}
else
{
d->setWindowTitle(qApp->applicationDisplayName());
d->setWindowTitle(d->floatingContainersTitle());
setWindowIcon(QApplication::windowIcon());
}
}