Implemented dialog dim detection