Update title bar label when the widget's title changes. (#798)
This commit is contained in:
@@ -934,6 +934,19 @@ void CDockAreaWidget::updateTitleBarVisibility()
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
void CDockAreaWidget::updateWindowTitle()
|
||||
{
|
||||
auto currentWidget = d->ContentsLayout->currentWidget();
|
||||
if (d->TitleBar && currentWidget)
|
||||
{
|
||||
d->TitleBar->autoHideTitleLabel()->setText(currentWidget->windowTitle());
|
||||
}
|
||||
|
||||
markTitleBarMenuOutdated();
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
void CDockAreaWidget::markTitleBarMenuOutdated()
|
||||
{
|
||||
|
||||
@@ -165,6 +165,11 @@ protected:
|
||||
*/
|
||||
void internalSetCurrentDockWidget(CDockWidget* DockWidget);
|
||||
|
||||
/**
|
||||
* Call this function to update the window title
|
||||
*/
|
||||
void updateWindowTitle();
|
||||
|
||||
/**
|
||||
* Marks tabs menu to update
|
||||
*/
|
||||
|
||||
@@ -883,7 +883,7 @@ bool CDockWidget::event(QEvent *e)
|
||||
}
|
||||
if (d->DockArea)
|
||||
{
|
||||
d->DockArea->markTitleBarMenuOutdated();//update tabs menu
|
||||
d->DockArea->updateWindowTitle();
|
||||
}
|
||||
|
||||
auto FloatingWidget = floatingDockContainer();
|
||||
|
||||
Reference in New Issue
Block a user