added ALT modifier when clicking on mesh in layer window to set ALL layers visible

This commit is contained in:
Marco Callieri mcallieri 2011-02-10 16:45:30 +00:00
parent 0798d021d1
commit bf76f6e9b5

View File

@ -93,10 +93,10 @@ void LayerDialog::meshItemClicked (QTreeWidgetItem * item , int col)
{
//the user has clicked on one of the eyes
MeshDocument *md= mw->meshDoc();
// NICE TRICK.
// If the user has pressed ctrl when clicking on the eye icon, only that layer will remain visible
// Very useful for comparing meshes
if(QApplication::keyboardModifiers() == Qt::ControlModifier)
{
foreach(MeshModel *mp, md->meshList)
@ -104,8 +104,21 @@ void LayerDialog::meshItemClicked (QTreeWidgetItem * item , int col)
mw->GLA()->meshSetVisibility(mp, false);
}
}
//Toggle visibility of current mesh
mw->GLA()->meshSetVisibility(md->getMesh(clickedId), !md->getMesh(clickedId)->visible);
// EVEN NICER TRICK.
// If the user has pressed alt when clicking on the eye icon, all layers will get visible
// Very useful after you turned all layer invis using the previous option and want to avoid
// clicking on all of them...
if(QApplication::keyboardModifiers() == Qt::AltModifier)
{
foreach(MeshModel *mp, md->meshList)
{
mw->GLA()->meshSetVisibility(mp, true);
}
}
} break;
case 1 :