Problem
When unchecking "Hide in Viewport" option for a collection it grays out itself and his children collections but
not his children objects.
It doesn't make sense because if you uncheck the option in the child object item it's grayed out.
So the same should occur if it's single parent collection option is unchecked.
Patch
For checking an object visibility in the viewport the flag "BASE_VISIBLE_VIEWLAYER"
should be used instead of "BASE_VISIBLE_DEPSGRAPH" because the later ignores viewport visibility.