Skip to content

Commit 0425293

Browse files
hansonrhansonr
authored andcommitted
JCheckBox button vertical offest fix; JSlider minimum,preferred size fix
1 parent 08c7515 commit 0425293

File tree

8 files changed

+30
-2
lines changed

8 files changed

+30
-2
lines changed
3.77 MB
Binary file not shown.
187 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20180901005436
1+
20180913053826
187 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20180901005436
1+
20180913053826
187 Bytes
Binary file not shown.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ protected Dimension setHTMLSize(DOMNode obj, boolean addCSS) {
121121
} else {
122122
d = setHTMLSize1(obj, addCSS, false);
123123
DOMNode.setPositionAbsolute(textNode);
124+
DOMNode.setPositionAbsolute(iconNode);
124125
DOMNode.setPositionAbsolute(buttonNode);
125126
// if (centeringNode != null) problems with vertical offset
126127
// DOMNode.setPositionAbsolute(centeringNode);

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,33 @@ void setScrollBarExtentAndCSS() {
378378
// ScrollBar subclass only
379379
}
380380

381+
382+
public Dimension getMinimumSize(JComponent c) {
383+
return (isScrollBar ? super.getMinimumSize(c)
384+
: isHoriz ? getMinimumHorizontalSize() : getMinimumVerticalSize());
385+
}
386+
387+
private Dimension getMinimumHorizontalSize() {
388+
Dimension horizDim = (Dimension) DefaultLookup.get(jSlider, this,
389+
"Slider.minimumHorizontalSize");
390+
if (horizDim == null) {
391+
horizDim = new Dimension(36, 21);
392+
}
393+
return horizDim;
394+
}
395+
396+
private Dimension getMinimumVerticalSize() {
397+
Dimension vertDim = (Dimension) DefaultLookup.get(jSlider, this,
398+
"Slider.minimumVerticalSize");
399+
if (vertDim == null) {
400+
vertDim = new Dimension(21, 36);
401+
}
402+
return vertDim;
403+
}
404+
405+
public Dimension getPreferredSize(JComponent c) {
406+
return (isScrollBar ? super.getPreferredSize(c) : isHoriz ? getPreferredHorizontalSize() : getPreferredVerticalSize());
407+
}
381408

382409
public Dimension getPreferredHorizontalSize() {
383410
Dimension horizDim = (Dimension) DefaultLookup.get(jSlider, this,

0 commit comments

Comments
 (0)