mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DPI-aware empty borders
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,6 +27,7 @@ import com.intellij.ui.components.panels.OpaquePanel;
|
||||
import com.intellij.ui.popup.PopupFactoryImpl;
|
||||
import com.intellij.ui.popup.WizardPopup;
|
||||
import com.intellij.ui.popup.list.PopupListElementRenderer;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -94,11 +95,11 @@ public class BranchActionGroupPopup extends PopupFactoryImpl.ActionGroupPopup {
|
||||
protected JComponent createItemComponent() {
|
||||
myTextLabel = new ErrorLabel();
|
||||
myTextLabel.setOpaque(true);
|
||||
myTextLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||||
myTextLabel.setBorder(JBUI.Borders.empty(1));
|
||||
|
||||
myBranchLabel = new ErrorLabel();
|
||||
myBranchLabel.setOpaque(true);
|
||||
myBranchLabel.setBorder(BorderFactory.createEmptyBorder(1, UIUtil.DEFAULT_HGAP, 1, 1));
|
||||
myBranchLabel.setBorder(JBUI.Borders.empty(1, UIUtil.DEFAULT_HGAP, 1, 1));
|
||||
|
||||
JPanel compoundPanel = new OpaquePanel(new BorderLayout(), JBColor.WHITE);
|
||||
compoundPanel.add(myTextLabel, BorderLayout.CENTER);
|
||||
|
||||
@@ -83,7 +83,7 @@ public class PluginModuleBuildConfEditor implements ModuleConfigurationEditor {
|
||||
gc.weighty = 1.0;
|
||||
manifestPanel.add(myManifest, gc);
|
||||
myWholePanel.add(manifestPanel, gc);
|
||||
myWholePanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
|
||||
myWholePanel.setBorder(JBUI.Borders.empty(5));
|
||||
return myWholePanel;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Splitter;
|
||||
import com.intellij.openapi.util.UserDataHolderBase;
|
||||
import com.intellij.reference.SoftReference;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -66,7 +67,7 @@ public class TestDataGroupFileEditor extends UserDataHolderBase implements FileE
|
||||
private static JComponent wrapWithTitle(String name, final FileEditor beforeEditor) {
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
final JLabel label = new JLabel(name);
|
||||
label.setBorder(BorderFactory.createEmptyBorder(1, 4, 2, 0));
|
||||
label.setBorder(JBUI.Borders.empty(1, 4, 2, 0));
|
||||
label.setFont(label.getFont().deriveFont(Font.BOLD));
|
||||
panel.add(BorderLayout.NORTH, label);
|
||||
panel.add(BorderLayout.CENTER, beforeEditor.getComponent());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.vcs.changes.ui.ChangesBrowser;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import git4idea.GitCommit;
|
||||
import git4idea.repo.GitRepository;
|
||||
@@ -161,7 +162,7 @@ class GitCompareBranchesLogPanel extends JPanel {
|
||||
|
||||
JPanel bth = new JPanel(new BorderLayout());
|
||||
JBLabel descriptionLabel = new JBLabel(desc, UIUtil.ComponentStyle.SMALL);
|
||||
descriptionLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
|
||||
descriptionLabel.setBorder(JBUI.Borders.emptyBottom(5));
|
||||
bth.add(descriptionLabel, BorderLayout.NORTH);
|
||||
bth.add(forward ? myHeadToBranchListPanel : myBranchToHeadListPanel);
|
||||
return bth;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,6 +26,7 @@ import com.intellij.ui.DocumentAdapter;
|
||||
import com.intellij.ui.HyperlinkAdapter;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.github.api.GithubApiUtil;
|
||||
@@ -85,7 +86,7 @@ public class GithubSettingsPanel {
|
||||
mySignupTextField.setText("<html>Do not have an account at github.com? <a href=\"https://github.com\">" + "Sign up" + "</a></html>");
|
||||
mySignupTextField.setBackground(myPane.getBackground());
|
||||
mySignupTextField.setCursor(new Cursor(Cursor.HAND_CURSOR));
|
||||
myAuthTypeLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
|
||||
myAuthTypeLabel.setBorder(JBUI.Borders.emptyLeft(10));
|
||||
myAuthTypeComboBox.addItem(AUTH_PASSWORD);
|
||||
myAuthTypeComboBox.addItem(AUTH_TOKEN);
|
||||
|
||||
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,6 +36,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.gradle.util.GradleBundle;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile;
|
||||
@@ -130,7 +131,7 @@ class AddGradleDslPluginActionHandler implements CodeInsightActionHandler {
|
||||
|
||||
public MyListCellRenderer() {
|
||||
myPanel = new JPanel(new BorderLayout());
|
||||
myPanel.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
|
||||
myPanel.setBorder(JBUI.Borders.emptyLeft(2));
|
||||
myNameLabel = new JLabel();
|
||||
|
||||
myPanel.add(myNameLabel, BorderLayout.WEST);
|
||||
|
||||
Reference in New Issue
Block a user