Use Page Label for Tab Text

This commit is contained in:
wandererfan
2018-10-19 11:56:51 -04:00
committed by Yorik van Havre
parent 8280d551a9
commit 3ca8eb0989
3 changed files with 15 additions and 9 deletions

View File

@@ -154,8 +154,12 @@ void ViewProviderPage::updateData(const App::Property* prop)
m_mdiView->matchSceneRectToTemplate();
m_mdiView->updateTemplate();
}
} else if (prop == &(getDrawPage()->Label)) {
if(m_mdiView &&
!getDrawPage()->isUnsetting()) {
m_mdiView->setTabText(getDrawPage()->Label.getValue());
}
}
Gui::ViewProviderDocumentObject::updateData(prop);
}
@@ -214,7 +218,8 @@ bool ViewProviderPage::showMDIViewPage()
Gui::Document* doc = Gui::Application::Instance->getDocument
(pcObject->getDocument());
m_mdiView = new MDIViewPage(this, doc, Gui::getMainWindow());
QString tabTitle = QString::fromUtf8(getDrawPage()->getNameInDocument());
// QString tabTitle = QString::fromUtf8(getDrawPage()->getNameInDocument());
QString tabTitle = QString::fromUtf8(getDrawPage()->Label.getValue());
m_mdiView->setDocumentObject(getDrawPage()->getNameInDocument());
m_mdiView->setDocumentName(pcObject->getDocument()->getName());