DPI-aware empty borders

This commit is contained in:
Konstantin Bulenkov
2016-04-11 22:45:49 +02:00
parent e04da72fb5
commit 3723f36676
5 changed files with 22 additions and 17 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 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.
@@ -29,6 +29,7 @@ import com.intellij.ui.ComboboxWithBrowseButton;
import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.components.JBCheckBox;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -96,7 +97,7 @@ public class CreateBranchOrTagDialog extends DialogWrapper {
setResizable(true);
setTitle(SvnBundle.message("dialog.title.branch"));
getHelpAction().setEnabled(true);
myUseThisVariantToLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
myUseThisVariantToLabel.setBorder(JBUI.Borders.emptyBottom(10));
myProjectButton.setIcon(AllIcons.Nodes.IdeaProject);
myBranchTagBaseComboBox.setPreferredSize(new Dimension(myBranchTagBaseComboBox.getPreferredSize().width,
myWorkingCopyField.getPreferredSize().height));
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 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.components.JBList;
import com.intellij.util.NullableFunction;
import com.intellij.util.continuation.ModalityIgnorantBackgroundableTask;
import com.intellij.util.text.DateFormatUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -287,9 +288,9 @@ public class SelectBranchPopup {
super(new BorderLayout());
add(myUrlLabel, BorderLayout.WEST);
add(myDateLabel, BorderLayout.EAST);
myUrlLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
myDateLabel.setHorizontalAlignment(JLabel.RIGHT);
myDateLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
myUrlLabel.setBorder(JBUI.Borders.empty(1));
myDateLabel.setHorizontalAlignment(SwingConstants.RIGHT);
myDateLabel.setBorder(JBUI.Borders.empty(1));
myDateLabel.setForeground(UIUtil.getInactiveTextColor());
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 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.
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn.dialogs;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ui.JBUI;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnBundle;
@@ -93,7 +94,7 @@ public class ServerSSHDialog extends DialogWrapper {
@Override
protected JComponent createCenterPanel() {
JPanel panel = new JPanel(new BorderLayout(5,5));
JPanel panel = JBUI.Panels.simplePanel(5, 5);
final JPanel wrapper = new JPanel();
final BoxLayout boxLayout = new BoxLayout(wrapper, BoxLayout.Y_AXIS);
wrapper.setLayout(boxLayout);
@@ -103,10 +104,10 @@ public class ServerSSHDialog extends DialogWrapper {
wrapper.add(label2);
final JTextField textField = new JTextField(myFingerprints);
textField.setEditable(false);
textField.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
textField.setBorder(JBUI.Borders.empty(10, 0));
wrapper.add(textField);
final JLabel label3 = new JLabel(SvnBundle.message("label.ssh.server.provided.fingerprints3"));
label3.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
label3.setBorder(JBUI.Borders.emptyBottom(5));
wrapper.add(label3);
panel.add(wrapper, BorderLayout.CENTER);
myJCheckBox = new JCheckBox(SvnBundle.message("checkbox.svn.ssh.cache.fingerprint"));
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 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.
@@ -30,6 +30,7 @@ import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.EditorTextField;
import com.intellij.ui.PopupHandler;
import com.intellij.util.ui.GridBag;
import com.intellij.util.ui.JBUI;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.SvnVcs;
@@ -162,7 +163,7 @@ public class CopyOptionsDialog extends DialogWrapper {
recentMessagesWrapper.add(new JLabel("Recent Messages:"), BorderLayout.NORTH);
myMessagesBox = new JComboBox();
recentMessagesWrapper.add(myMessagesBox, BorderLayout.SOUTH);
recentMessagesWrapper.setBorder(BorderFactory.createEmptyBorder(4,0,0,0));
recentMessagesWrapper.setBorder(JBUI.Borders.emptyTop(4));
myMainPanel.add(recentMessagesWrapper, BorderLayout.SOUTH);
}
@@ -179,7 +180,7 @@ public class CopyOptionsDialog extends DialogWrapper {
private JPanel createBrowserPartWrapper() {
final JPanel wrapper = new JPanel(new GridBagLayout());
final GridBag gridBag = new GridBag().setDefaultAnchor(GridBagConstraints.NORTHWEST)
.setDefaultFill(GridBagConstraints.NONE).setDefaultInsets(1,1,1,1).setDefaultWeightX(1).setDefaultWeightY(0);
.setDefaultFill(GridBagConstraints.NONE).setDefaultInsets(JBUI.insets(1)).setDefaultWeightX(1).setDefaultWeightY(0);
gridBag.nextLine().next();
gridBag.weightx(0);
@@ -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.
@@ -17,6 +17,7 @@ package org.jetbrains.idea.svn.integrate;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.MultiLineLabelUI;
import com.intellij.util.ui.JBUI;
import javax.swing.*;
import java.awt.event.ActionEvent;
@@ -51,9 +52,9 @@ public class QuickMergeWayOptionsPanel {
myShowsAllRevisionsFromLabel.setUI(new MultiLineLabelUI());
myFindsWhereOneOfLabel.setUI(new MultiLineLabelUI());
myAllNotMergedRevisionsLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
myShowsAllRevisionsFromLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
myFindsWhereOneOfLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
myAllNotMergedRevisionsLabel.setBorder(JBUI.Borders.emptyBottom(10));
myShowsAllRevisionsFromLabel.setBorder(JBUI.Borders.emptyBottom(10));
myFindsWhereOneOfLabel.setBorder(JBUI.Borders.emptyBottom(10));
}
private ActionListener setCodeAndClose(final QuickMergeContentsVariants variant) {