code: def toggle_view(self, checked):
          
          if checked:
              self.dockwidget.show()
              self.dockwidget.raise_()
              # Start a client in case there are none shown
              if not self.clients:
                  if self.main.is_setting_up:
                      self.create_new_client(give_focus=False)
                  else:
                      self.create_new_client(give_focus=True)
          else:
              self.dockwidget.hide()
docs: Toggle view