Add functionality for hiding and showing control panels