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

@@ -559,13 +559,12 @@ bool MDIViewPage::onHasMsg(const char* pMsg) const
return false;
}
void MDIViewPage::onRelabel(Gui::Document *pDoc)
//called by ViewProvider when Page feature Label changes
void MDIViewPage::setTabText(std::string t)
{
if (!bIsPassive && pDoc) {
QString cap = QString::fromLatin1("%1 : %2[*]")
.arg(QString::fromUtf8(pDoc->getDocument()->Label.getValue()))
.arg(objectName());
if (!isPassive() && !t.empty()) {
QString cap = QString::fromLatin1("%1 [*]")
.arg(QString::fromUtf8(t.c_str()));
setWindowTitle(cap);
}
}