Added option to hide inactive documents in tree view.

This commit is contained in:
Markus Lampert
2018-09-05 19:40:50 -07:00
committed by wmayer
parent f231871cb0
commit 03d4f084c7
3 changed files with 41 additions and 0 deletions

View File

@@ -706,12 +706,15 @@ void TreeWidget::slotActiveDocument(const Gui::Document& Doc)
std::map<const Gui::Document*, DocumentItem*>::iterator jt = DocumentMap.find(&Doc);
if (jt == DocumentMap.end())
return; // signal is emitted before the item gets created
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
bool hideInactive = hGrp->GetBool("TreeHideInactiveDocs", false);
for (std::map<const Gui::Document*, DocumentItem*>::iterator it = DocumentMap.begin();
it != DocumentMap.end(); ++it)
{
QFont f = it->second->font(0);
f.setBold(it == jt);
it->second->setFont(0,f);
it->second->setHidden(hideInactive && it != jt);
}
}