Search in sources :

Example 21 with UISettings

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

the class ToolWindowsPane method updateLayout.

private void updateLayout() {
    UISettings uiSettings = UISettings.getInstance();
    if (myWidescreen != uiSettings.getWideScreenSupport()) {
        JComponent documentComponent = (myWidescreen ? myVerticalSplitter : myHorizontalSplitter).getInnerComponent();
        myWidescreen = uiSettings.getWideScreenSupport();
        if (myWidescreen) {
            myVerticalSplitter.setInnerComponent(null);
            myHorizontalSplitter.setInnerComponent(myVerticalSplitter);
        } else {
            myHorizontalSplitter.setInnerComponent(null);
            myVerticalSplitter.setInnerComponent(myHorizontalSplitter);
        }
        myLayeredPane.remove(myWidescreen ? myVerticalSplitter : myHorizontalSplitter);
        myLayeredPane.add(myWidescreen ? myHorizontalSplitter : myVerticalSplitter, DEFAULT_LAYER);
        setDocumentComponent(documentComponent);
    }
    if (myLeftHorizontalSplit != uiSettings.getLeftHorizontalSplit()) {
        JComponent component = getComponentAt(ToolWindowAnchor.LEFT);
        if (component instanceof Splitter) {
            Splitter splitter = (Splitter) component;
            InternalDecorator first = (InternalDecorator) splitter.getFirstComponent();
            InternalDecorator second = (InternalDecorator) splitter.getSecondComponent();
            setComponent(splitter, ToolWindowAnchor.LEFT, ToolWindowAnchor.LEFT.isSplitVertically() ? first.getWindowInfo().getWeight() : first.getWindowInfo().getWeight() + second.getWindowInfo().getWeight());
        }
        myLeftHorizontalSplit = uiSettings.getLeftHorizontalSplit();
    }
    if (myRightHorizontalSplit != uiSettings.getRightHorizontalSplit()) {
        JComponent component = getComponentAt(ToolWindowAnchor.RIGHT);
        if (component instanceof Splitter) {
            Splitter splitter = (Splitter) component;
            InternalDecorator first = (InternalDecorator) splitter.getFirstComponent();
            InternalDecorator second = (InternalDecorator) splitter.getSecondComponent();
            setComponent(splitter, ToolWindowAnchor.RIGHT, ToolWindowAnchor.RIGHT.isSplitVertically() ? first.getWindowInfo().getWeight() : first.getWindowInfo().getWeight() + second.getWindowInfo().getWeight());
        }
        myRightHorizontalSplit = uiSettings.getRightHorizontalSplit();
    }
}
Also used : ThreeComponentsSplitter(com.intellij.openapi.ui.ThreeComponentsSplitter) Splitter(com.intellij.openapi.ui.Splitter) UISettings(com.intellij.ide.ui.UISettings)

Example 22 with UISettings

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

the class ScrollSettings method isEligibleFor.

static boolean isEligibleFor(Component component) {
    if (component == null || !component.isShowing())
        return false;
    Application application = getApplication();
    if (application == null || application.isUnitTestMode())
        return false;
    if (PowerSaveMode.isEnabled())
        return false;
    if (RemoteDesktopService.isRemoteSession())
        return false;
    UISettings settings = UISettings.getInstanceOrNull();
    return settings != null && settings.getSmoothScrolling();
}
Also used : UISettings(com.intellij.ide.ui.UISettings) Application(com.intellij.openapi.application.Application) ApplicationManager.getApplication(com.intellij.openapi.application.ApplicationManager.getApplication)

Example 23 with UISettings

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

the class LafManagerImpl method patchLafFonts.

private void patchLafFonts(UIDefaults uiDefaults) {
    //if (JBUI.isHiDPI()) {
    //  HashMap<Object, Font> newFonts = new HashMap<Object, Font>();
    //  for (Object key : uiDefaults.keySet().toArray()) {
    //    Object val = uiDefaults.get(key);
    //    if (val instanceof Font) {
    //      newFonts.put(key, JBFont.create((Font)val));
    //    }
    //  }
    //  for (Map.Entry<Object, Font> entry : newFonts.entrySet()) {
    //    uiDefaults.put(entry.getKey(), entry.getValue());
    //  }
    //} else
    UISettings uiSettings = UISettings.getInstance();
    if (uiSettings.getOverrideLafFonts()) {
        storeOriginalFontDefaults(uiDefaults);
        JBUI.setUserScaleFactor(uiSettings.getFontSize() / UIUtil.DEF_SYSTEM_FONT_SIZE);
        initFontDefaults(uiDefaults, uiSettings.getFontSize(), new FontUIResource(uiSettings.getFontFace(), Font.PLAIN, uiSettings.getFontSize()));
    } else {
        restoreOriginalFontDefaults(uiDefaults);
    }
}
Also used : UISettings(com.intellij.ide.ui.UISettings) FontUIResource(javax.swing.plaf.FontUIResource)

Example 24 with UISettings

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

the class PresentationModeProgressPanel method createUIComponents.

private void createUIComponents() {
    myRootPanel = new TransparentPanel(0.5f) {

        @Override
        public boolean isVisible() {
            UISettings ui = UISettings.getInstance();
            return ui.getPresentationMode() || !ui.getShowStatusBar() && Registry.is("ide.show.progress.without.status.bar");
        }
    };
    IconButton iconButton = new IconButton(myProgress.getInfo().getCancelTooltipText(), AllIcons.Process.Stop, AllIcons.Process.StopHovered);
    myCancelButton = new InplaceButton(iconButton, new ActionListener() {

        @Override
        public void actionPerformed(@NotNull ActionEvent e) {
            myProgress.cancelRequest();
        }
    }).setFillBg(false);
}
Also used : UISettings(com.intellij.ide.ui.UISettings) IconButton(com.intellij.openapi.ui.popup.IconButton) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) TransparentPanel(com.intellij.ui.TransparentPanel) InplaceButton(com.intellij.ui.InplaceButton)

Example 25 with UISettings

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

the class EditorTextField method setupEditorFont.

private void setupEditorFont(final EditorEx editor) {
    if (myInheritSwingFont) {
        ((EditorImpl) editor).setUseEditorAntialiasing(false);
        editor.getColorsScheme().setEditorFontName(getFont().getFontName());
        editor.getColorsScheme().setEditorFontSize(getFont().getSize());
        return;
    }
    UISettings settings = UISettings.getInstance();
    if (settings.getPresentationMode())
        editor.setFontSize(settings.getPresentationModeFontSize());
}
Also used : UISettings(com.intellij.ide.ui.UISettings) EditorImpl(com.intellij.openapi.editor.impl.EditorImpl)

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