Search in sources :

Example 6 with JBInsets

use of com.intellij.util.ui.JBInsets in project intellij-community by JetBrains.

the class DarculaTextFieldUI method getDrawingRect.

protected Rectangle getDrawingRect() {
    final JTextComponent c = myTextField;
    final JBInsets i = JBInsets.create(c.getInsets());
    final int x = i.right - JBUI.scale(4) - JBUI.scale(16);
    final int y = i.top - JBUI.scale(3);
    final int w = c.getWidth() - i.width() + JBUI.scale(16 * 2 + 7 * 2 - 5);
    int h = c.getBounds().height - i.height() + JBUI.scale(4 * 2 - 3);
    if (h % 2 == 1)
        h++;
    return new Rectangle(x, y, w, h);
}
Also used : JBInsets(com.intellij.util.ui.JBInsets) JTextComponent(javax.swing.text.JTextComponent)

Example 7 with JBInsets

use of com.intellij.util.ui.JBInsets in project intellij-community by JetBrains.

the class LafManagerImpl method updateUI.

/**
   * Updates LAF of all windows. The method also updates font of components
   * as it's configured in <code>UISettings</code>.
   */
@Override
public void updateUI() {
    final UIDefaults uiDefaults = UIManager.getLookAndFeelDefaults();
    fixPopupWeight();
    fixGtkPopupStyle();
    fixTreeWideSelection(uiDefaults);
    fixMenuIssues(uiDefaults);
    if (UIUtil.isUnderAquaLookAndFeel()) {
        uiDefaults.put("Panel.opaque", Boolean.TRUE);
    } else if (UIUtil.isWinLafOnVista()) {
        uiDefaults.put("ComboBox.border", null);
    }
    initInputMapDefaults(uiDefaults);
    uiDefaults.put("Button.defaultButtonFollowsFocus", Boolean.FALSE);
    uiDefaults.put("Balloon.error.textInsets", new JBInsets(3, 8, 3, 8).asUIResource());
    patchFileChooserStrings(uiDefaults);
    patchLafFonts(uiDefaults);
    patchHiDPI(uiDefaults);
    patchGtkDefaults(uiDefaults);
    fixSeparatorColor(uiDefaults);
    updateToolWindows();
    for (Frame frame : Frame.getFrames()) {
        // So we need to set frames background to exact and correct value.
        if (SystemInfo.isMac) {
            //noinspection UseJBColor
            frame.setBackground(new Color(UIUtil.getPanelBackground().getRGB()));
        }
        updateUI(frame);
    }
    fireLookAndFeelChanged();
}
Also used : JBColor(com.intellij.ui.JBColor) JBInsets(com.intellij.util.ui.JBInsets)

Example 8 with JBInsets

use of com.intellij.util.ui.JBInsets in project intellij-community by JetBrains.

the class MacIntelliJSpinnerUI method layoutEditor.

@Override
protected void layoutEditor(@NotNull JComponent editor) {
    int w = spinner.getWidth();
    int h = spinner.getHeight();
    JBInsets insets = JBUI.insets(spinner.getInsets());
    editor.setBounds(insets.left + 5, insets.top + 5, w - 5 - 26 - insets.width(), h - insets.height() - 10);
}
Also used : JBInsets(com.intellij.util.ui.JBInsets)

Aggregations

JBInsets (com.intellij.util.ui.JBInsets)7 JBCheckBox (com.intellij.ui.components.JBCheckBox)3 Settings (com.intellij.openapi.options.ex.Settings)2 Project (com.intellij.openapi.project.Project)2 StringUtil (com.intellij.openapi.util.text.StringUtil)2 JBLabel (com.intellij.ui.components.JBLabel)2 Alarm (com.intellij.util.Alarm)2 CommenterForm (com.intellij.application.options.codeStyle.CommenterForm)1 HighlightDisplayLevel (com.intellij.codeHighlighting.HighlightDisplayLevel)1 DaemonCodeAnalyzer (com.intellij.codeInsight.daemon.DaemonCodeAnalyzer)1 HighlightDisplayKey (com.intellij.codeInsight.daemon.HighlightDisplayKey)1 HighlightInfoType (com.intellij.codeInsight.daemon.impl.HighlightInfoType)1 SeverityRegistrar (com.intellij.codeInsight.daemon.impl.SeverityRegistrar)1 HintUtil (com.intellij.codeInsight.hint.HintUtil)1 InspectionsBundle (com.intellij.codeInspection.InspectionsBundle)1 com.intellij.codeInspection.ex (com.intellij.codeInspection.ex)1 SpecialAnnotationsUtil (com.intellij.codeInspection.util.SpecialAnnotationsUtil)1 AllIcons (com.intellij.icons.AllIcons)1 com.intellij.ide (com.intellij.ide)1 SearchUtil (com.intellij.ide.ui.search.SearchUtil)1