Search in sources :

Example 11 with UISettings

use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.

the class ToggleDistractionFreeModeAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    Project project = e.getProject();
    alternateCurrentDistractionFreeModeSetting();
    boolean enter = isDistractionFreeModeEnabled();
    if (project == null)
        return;
    PropertiesComponent p = PropertiesComponent.getInstance();
    UISettings ui = UISettings.getInstance();
    EditorSettingsExternalizable.OptionSet eo = EditorSettingsExternalizable.getInstance().getOptions();
    DaemonCodeAnalyzerSettings ds = DaemonCodeAnalyzerSettings.getInstance();
    String before = "BEFORE.DISTRACTION.MODE.";
    String after = "AFTER.DISTRACTION.MODE.";
    if (enter) {
        applyAndSave(p, ui, eo, ds, before, after, false);
        TogglePresentationModeAction.storeToolWindows(project);
    } else {
        applyAndSave(p, ui, eo, ds, after, before, true);
        TogglePresentationModeAction.restoreToolWindows(project, true, false);
    }
    UISettings.getInstance().fireUISettingsChanged();
    LafManager.getInstance().updateUI();
    EditorUtil.reinitSettings();
    DaemonCodeAnalyzer.getInstance(project).settingsChanged();
    EditorFactory.getInstance().refreshAllEditors();
}
Also used : DaemonCodeAnalyzerSettings(com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings) Project(com.intellij.openapi.project.Project) UISettings(com.intellij.ide.ui.UISettings) PropertiesComponent(com.intellij.ide.util.PropertiesComponent) EditorSettingsExternalizable(com.intellij.openapi.editor.ex.EditorSettingsExternalizable)

Example 12 with UISettings

use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.

the class TogglePresentationModeAction method setPresentationMode.

//public static void restorePresentationMode() {
//  UISettings instance = UISettings.getInstance();
//  tweakUIDefaults(instance, true);
//  tweakEditorAndFireUpdateUI(instance, true);
//}
public static void setPresentationMode(final Project project, final boolean inPresentation) {
    final UISettings settings = UISettings.getInstance();
    settings.setPresentationMode(inPresentation);
    final boolean layoutStored = storeToolWindows(project);
    tweakUIDefaults(settings, inPresentation);
    ActionCallback callback = project == null ? ActionCallback.DONE : tweakFrameFullScreen(project, inPresentation);
    callback.doWhenProcessed(() -> {
        tweakEditorAndFireUpdateUI(settings, inPresentation);
        restoreToolWindows(project, layoutStored, inPresentation);
    });
}
Also used : UISettings(com.intellij.ide.ui.UISettings) ActionCallback(com.intellij.openapi.util.ActionCallback)

Example 13 with UISettings

use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.

the class ViewToolbarAction method setSelected.

@Override
public void setSelected(AnActionEvent event, boolean state) {
    UISettings uiSettings = UISettings.getInstance();
    uiSettings.setShowMainToolbar(state);
    uiSettings.fireUISettingsChanged();
}
Also used : UISettings(com.intellij.ide.ui.UISettings)

Example 14 with UISettings

use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.

the class ViewStatusBarAction method setSelected.

@Override
public void setSelected(AnActionEvent e, boolean state) {
    UISettings uiSettings = UISettings.getInstance();
    uiSettings.setShowStatusBar(state);
    uiSettings.fireUISettingsChanged();
}
Also used : UISettings(com.intellij.ide.ui.UISettings)

Example 15 with UISettings

use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.

the class ActionMenu method updateIcon.

private void updateIcon() {
    UISettings settings = UISettings.getInstanceOrNull();
    if (settings != null && settings.getShowIconsInMenus()) {
        final Presentation presentation = myPresentation;
        final Icon icon = presentation.getIcon();
        setIcon(icon);
        if (presentation.getDisabledIcon() != null) {
            setDisabledIcon(presentation.getDisabledIcon());
        } else {
            setDisabledIcon(IconLoader.getDisabledIcon(icon));
        }
    }
}
Also used : UISettings(com.intellij.ide.ui.UISettings)

Aggregations

UISettings (com.intellij.ide.ui.UISettings)38 EditorSettingsExternalizable (com.intellij.openapi.editor.ex.EditorSettingsExternalizable)8 Project (com.intellij.openapi.project.Project)4 CodeInsightSettings (com.intellij.codeInsight.CodeInsightSettings)3 RichCopySettings (com.intellij.openapi.editor.richcopy.settings.RichCopySettings)3 VcsApplicationSettings (com.intellij.openapi.vcs.VcsApplicationSettings)3 EditorColorsScheme (com.intellij.openapi.editor.colors.EditorColorsScheme)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 HyperlinkEvent (javax.swing.event.HyperlinkEvent)2 DaemonCodeAnalyzerSettings (com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings)1 QuickDocOnMouseOverManager (com.intellij.codeInsight.documentation.QuickDocOnMouseOverManager)1 ColorBlindness (com.intellij.ide.ui.ColorBlindness)1 UISettingsListener (com.intellij.ide.ui.UISettingsListener)1 PropertiesComponent (com.intellij.ide.util.PropertiesComponent)1 Notification (com.intellij.notification.Notification)1 NotificationListener (com.intellij.notification.NotificationListener)1 Application (com.intellij.openapi.application.Application)1 ApplicationManager.getApplication (com.intellij.openapi.application.ApplicationManager.getApplication)1