Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
label centering broken
  • Loading branch information
hansonr authored and hansonr committed Dec 17, 2018
commit a88e79ca9683bed45c06265fd844c021db04f485
Original file line number Diff line number Diff line change
Expand Up @@ -2179,11 +2179,8 @@ protected void setHorizontalButtonAlignments(AbstractButton b, int hTextPos, int
// DOMNode.setAttr(textNode, "innerHTML", pos);


int wIcon = (iconNode == null ? 0 : imageNode == null ? 20 : Math.max(0, setHTMLSize1(iconNode, false, false).width - 1));
if (isMenuItem && actionNode != null)
wIcon = 15;
int wText = setHTMLSize1(textNode, false, false).width - 1;

int wIcon = (actionNode != null ? (isMenuItem ? 15 : 20) : iconNode == null ? 0 : imageNode == null ? 0 : Math.max(0, setHTMLSize1(iconNode, false, false).width - 1));
int wText = setHTMLSize1(textNode, false, false).width - 1;
int gap = (wText == 0 || wIcon == 0 ? 0 : b.getIconTextGap());

// But we need to slightly underestimate it so that the
Expand Down Expand Up @@ -2261,7 +2258,7 @@ protected void setHorizontalButtonAlignments(AbstractButton b, int hTextPos, int
DOMNode.setStyles(domNode, "text-align", alignlr, poslr, px0);
//}
if (centered) {
int w = setHTMLSize1((buttonNode == null ? domNode : centeringNode), false, false).width;
int w = cellComponent != null ? cellWidth : setHTMLSize1((buttonNode == null ? domNode : centeringNode), false, false).width;
switch (hTextPos) {
case SwingConstants.CENTER:
case SwingConstants.TOP:
Expand Down