Added option to hide inactive documents in tree view.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user