Skip to content

Commit 0dc5aea

Browse files
hansonrhansonr
authored andcommitted
Menu font line spacing fix
1 parent 053bc55 commit 0dc5aea

File tree

6 files changed

+8
-13
lines changed

6 files changed

+8
-13
lines changed
105 Bytes
Binary file not shown.
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<<<<<<< HEAD
2-
20181117143423
3-
=======
4-
20181117133636
5-
>>>>>>> branch 'hanson1' of https://github.com/BobHanson/java2script.git
1+
20181117145755
105 Bytes
Binary file not shown.
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<<<<<<< HEAD
2-
20181117143423
3-
=======
4-
20181117133636
5-
>>>>>>> branch 'hanson1' of https://github.com/BobHanson/java2script.git
1+
20181117145755
105 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSRadioButtonUI.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ protected void setupButton(JToggleButton b, boolean doAll) {
9292
DOMNode.setStyles(iconNode, "position", null);
9393
DOMNode.setStyles(textNode, "position", null);
9494
Dimension dim = null;
95-
dim = setHTMLSize1(wrap("div", "", iconNode, textNode), false, false);
9695
vCenter(iconNode, (actionNode == null ? -15 : isMenuItem ? -110 : -75), isMenuItem ? 0.6f : 0);
96+
dim = setHTMLSize1(wrap("div", "", iconNode, textNode), false, false);
9797
vCenter(textNode, -50, 0);
9898
setHorizontalButtonAlignments(b, b.getHorizontalTextPosition(), b.getHorizontalAlignment());
9999
if (!isMenuItem) { // only problem here is menu width
@@ -103,8 +103,11 @@ protected void setupButton(JToggleButton b, boolean doAll) {
103103
if (doAll && !isMenuItem)
104104
DOMNode.setPositionAbsolute(domNode);
105105
if (dim != null) {
106-
DOMNode.setSize(buttonNode, dim.width, dim.height);
107-
DOMNode.setSize(centeringNode, dim.width, dim.height);
106+
int ht = (isMenuItem ? c.getFont().getSize() + 3 : 36);
107+
if (ht > 18)
108+
ht = dim.height;
109+
DOMNode.setSize(buttonNode, dim.width, ht);
110+
DOMNode.setSize(centeringNode, dim.width, ht);
108111
}
109112
}
110113

0 commit comments

Comments
 (0)