@Override
  public void actionPerformed(@NotNull AnActionEvent e) {
    RegistryValue value = RegistryManager.getInstance().get(DistractionFreeModeController.KEY);
    boolean enter = !value.asBoolean();
    value.setValue(enter);

    Project project = e.getProject();
    if (project == null) {
      return;
    }

    PropertiesComponent.getInstance().setValue(DistractionFreeModeController.LAST_ENTER_VALUE, String.valueOf(enter));

    if (SystemInfo.isMac) {
      MacFullScreenControlsManager.INSTANCE.updateForDistractionFreeMode(enter);
    }

    applyAndSave(PropertiesComponent.getInstance(),
                 UISettings.getInstance(),
                 ToolbarSettings.getInstance(),
                 EditorSettingsExternalizable.getInstance().getOptions(),
                 DaemonCodeAnalyzerSettings.getInstance(),
                 enter ? DistractionFreeModeController.BEFORE : DistractionFreeModeController.AFTER,
                 enter ? DistractionFreeModeController.AFTER : DistractionFreeModeController.BEFORE,
                 !enter);
    if (enter) {
      TogglePresentationModeAction.storeToolWindows(project, false);
    }

    UISettings uiSettings = UISettings.getInstance();
    uiSettings.fireUISettingsChanged();
    LafManager.getInstance().updateUI();
    EditorUtil.reinitSettings();
    DaemonCodeAnalyzer.getInstance(project).settingsChanged();
    EditorFactory.getInstance().refreshAllEditors();
    if (!enter) {
      TogglePresentationModeAction.restoreToolWindows(project, false);
    }
  }
@Override
  public void actionPerformed(@NotNull AnActionEvent e)