mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix titled-border-induced relayout on innocent label text change
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
package com.intellij.ui.border;
|
||||
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.xmlb.annotations.Text;
|
||||
import sun.swing.SwingUtilities2;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.*;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.border.TitledBorder;
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
@@ -41,6 +42,14 @@ public class IdeaTitledBorder extends TitledBorder {
|
||||
this.titlePosition = TOP;
|
||||
|
||||
calculateInsets();
|
||||
|
||||
this.border = BorderFactory.createCompoundBorder(new EmptyBorder(outsideInsets),
|
||||
BorderFactory.createCompoundBorder(
|
||||
BorderFactory.createMatteBorder(1, 0, 0, 0, UIUtil.getTitledBorderColor()),
|
||||
new EmptyBorder(insideInsets)));
|
||||
|
||||
this.titleFont = UIUtil.getBorderFont(smallFont ? UIUtil.FontSize.SMALL : UIUtil.FontSize.NORMAL, boldFont);
|
||||
this.titleColor = UIUtil.getBorderTitleColor();
|
||||
}
|
||||
|
||||
private void calculateInsets() {
|
||||
@@ -70,14 +79,6 @@ public class IdeaTitledBorder extends TitledBorder {
|
||||
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
|
||||
|
||||
this.titleFont = UIUtil.getBorderFont(smallFont ? UIUtil.FontSize.SMALL : UIUtil.FontSize.NORMAL, boldFont);
|
||||
this.titleColor = UIUtil.getBorderTitleColor();
|
||||
this.border = BorderFactory.createCompoundBorder(new EmptyBorder(outsideInsets),
|
||||
BorderFactory.createCompoundBorder(
|
||||
BorderFactory.createMatteBorder(1, 0, 0, 0, UIUtil.getTitledBorderColor()),
|
||||
new EmptyBorder(insideInsets)));
|
||||
|
||||
g.setPaintMode();
|
||||
|
||||
Point textLoc = new Point();
|
||||
|
||||
Reference in New Issue
Block a user