Browse Source

Improved padding for more tabs button.

pull/75/head
weisj 5 years ago
parent
commit
13b5f3f819
  1. 4
      core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/MoreTabsButton.java

4
core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/MoreTabsButton.java

@ -58,7 +58,7 @@ public class MoreTabsButton extends DarkTabAreaButton {
FontMetrics metrics = g.getFontMetrics(); FontMetrics metrics = g.getFontMetrics();
String label = getLabelString(); String label = getLabelString();
int labelWidth = metrics.stringWidth(label); int labelWidth = metrics.stringWidth(label);
int x = (getWidth() - (icon.getIconWidth() + labelWidth + pad)) / 2 + pad; int x = (getWidth() - (icon.getIconWidth() + labelWidth + pad)) / 2;
int y = (getHeight() - icon.getIconHeight()) / 2; int y = (getHeight() - icon.getIconHeight()) / 2;
@ -93,7 +93,7 @@ public class MoreTabsButton extends DarkTabAreaButton {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize(); Dimension size = super.getPreferredSize();
FontMetrics metrics = getFontMetrics(getFont()); FontMetrics metrics = getFontMetrics(getFont());
size.width += metrics.stringWidth(getLabelString()) + 3 * pad; size.width += metrics.stringWidth(getLabelString()) + 4 * pad;
return size; return size;
} }
} }

Loading…
Cancel
Save