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