mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
adjust borders in show overrides popup title panel
This commit is contained in:
@@ -269,24 +269,14 @@ public class AbstractPopup implements JBPopup {
|
||||
myCaption.setButtonComponent(new InplaceButton(
|
||||
new IconButton("Open as Tool Window",
|
||||
AllIcons.General.AutohideOff, AllIcons.General.AutohideOff, AllIcons.General.AutohideOffInactive),
|
||||
new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
pinCallback.process(AbstractPopup.this);
|
||||
}
|
||||
}
|
||||
));
|
||||
e -> pinCallback.process(this)
|
||||
), JBUI.Borders.empty(4));
|
||||
}
|
||||
else if (cancelButton != null) {
|
||||
myCaption.setButtonComponent(new InplaceButton(cancelButton, new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
cancel();
|
||||
}
|
||||
}));
|
||||
myCaption.setButtonComponent(new InplaceButton(cancelButton, e -> cancel()), JBUI.Borders.empty(4));
|
||||
}
|
||||
else if (commandButton != null) {
|
||||
myCaption.setButtonComponent(commandButton);
|
||||
myCaption.setButtonComponent(commandButton, null);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -18,9 +18,10 @@ package com.intellij.ui;
|
||||
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.border.Border;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
@@ -106,11 +107,12 @@ public class CaptionPanel extends JPanel {
|
||||
repaint();
|
||||
}
|
||||
|
||||
public void setButtonComponent(@NotNull ActiveComponent component) {
|
||||
public void setButtonComponent(@NotNull ActiveComponent component, @Nullable Border border) {
|
||||
if (myButtonComponent != null) {
|
||||
remove(myButtonComponent.getComponent());
|
||||
}
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
panel.setBorder(border);
|
||||
panel.add(new JLabel(" "), BorderLayout.WEST);
|
||||
panel.add(component.getComponent(), BorderLayout.CENTER);
|
||||
panel.setOpaque(false);
|
||||
|
||||
Reference in New Issue
Block a user