mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-136679 IDEA-136694 diff: fix title painting
* allow to resize panels with long title * show ellipsis for too long title * add borders
This commit is contained in:
@@ -48,6 +48,7 @@ import com.intellij.openapi.util.Couple;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.util.ui.AnimatedIcon;
|
||||
import com.intellij.util.ui.AsyncProcessIcon;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -451,6 +452,7 @@ public class BinaryDiffViewer extends ListenerDiffViewerBase {
|
||||
myBusySpinner.setVisible(false);
|
||||
|
||||
add(myBusySpinner, BorderLayout.WEST);
|
||||
setBorder(IdeBorderFactory.createEmptyBorder(0, 4, 0, 4));
|
||||
}
|
||||
|
||||
public void setBusy(boolean busy) {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.diff.tools.util;
|
||||
|
||||
import com.intellij.openapi.diff.DiffBundle;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.util.ui.AnimatedIcon;
|
||||
import com.intellij.util.ui.AsyncProcessIcon;
|
||||
|
||||
@@ -34,6 +35,7 @@ public abstract class StatusPanel extends JPanel {
|
||||
|
||||
add(myTextLabel, BorderLayout.CENTER);
|
||||
add(myBusySpinner, BorderLayout.WEST);
|
||||
setBorder(IdeBorderFactory.createEmptyBorder(0, 4, 0, 4));
|
||||
}
|
||||
|
||||
public void update() {
|
||||
|
||||
@@ -37,6 +37,7 @@ public class TwosideContentPanel extends JPanel {
|
||||
mySplitter = new DiffSplitter();
|
||||
mySplitter.setFirstComponent(new MyPanel(editor1, titleComponents.get(0)));
|
||||
mySplitter.setSecondComponent(new MyPanel(editor2, titleComponents.get(1)));
|
||||
mySplitter.setHonorComponentsMinimumSize(false);
|
||||
add(mySplitter, BorderLayout.CENTER);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -398,11 +398,13 @@ public class DiffUtil {
|
||||
if (readOnly) title += " " + DiffBundle.message("diff.content.read.only.content.title.suffix");
|
||||
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
panel.setBorder(IdeBorderFactory.createEmptyBorder(0, 4, 0, 0));
|
||||
panel.add(createTitlePanel(title), BorderLayout.WEST);
|
||||
panel.setBorder(IdeBorderFactory.createEmptyBorder(0, 4, 0, 4));
|
||||
panel.add(createTitlePanel(title), BorderLayout.CENTER);
|
||||
if (charset != null && separator != null) {
|
||||
JPanel panel2 = new JPanel();
|
||||
panel2.setLayout(new BoxLayout(panel2, BoxLayout.X_AXIS));
|
||||
panel2.add(createCharsetPanel(charset));
|
||||
panel2.add(Box.createRigidArea(new Dimension(4, 0)));
|
||||
panel2.add(createSeparatorPanel(separator));
|
||||
panel.add(panel2, BorderLayout.EAST);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user