Allow passing a function as well as boolean for the autohide preferences
to allow more control over how it works.