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();
}
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);
});
}
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();
}
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();
}
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));
}
}
}
Aggregations