Skip to content

Commit 46ccae9

Browse files
author
zhourenjian
committed
Fixed bug that ScrollBar's "up" and "down" buttons is not working in Firefox
Fixed bug that Combo#setSelection is not accurate
1 parent 32a29b6 commit 46ccae9

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/Combo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,7 @@ public void setSelection (Point selection) {
20772077
int bits = start | (end << 16);
20782078
OS.SendMessage (handle, OS.CB_SETEDITSEL, 0, bits);
20792079
*/
2080-
Text.setTextSelection(textInput, selection.x, selection.y);
2080+
Text.setTextSelection(textInput, selection.x + 1, selection.y + 2);
20812081
}
20822082

20832083
/**

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/ScrollBar.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ protected void createVerticalScrollBar(Element parent, int sbOuterHeight, int sb
277277
sbHandle.style.width = (sbWidth + (needFixing ? 0.1 : 0)) + "px";
278278
}
279279
sbHandle.style.height = sbOuterHeight + "px";
280+
sbHandle.style.fontSize = increment * (maximum - minimum) / thumb + "px";
280281
outerHandle.appendChild(sbHandle);
281282

282283
innerHandle = document.createElement("DIV");
@@ -343,6 +344,7 @@ void updateScrollBar() {
343344
int innerSize = Math.round(size * (maximum - minimum) / thumb);
344345
if ((style & SWT.V_SCROLL) != 0) {
345346
innerHandle.style.height = innerSize + "px";
347+
sbHandle.style.fontSize = increment * (maximum - minimum) / thumb + "px";
346348
} else {
347349
innerHandle.style.width = innerSize + "px";
348350
}
@@ -810,6 +812,7 @@ public void setIncrement (int value) {
810812
if (value < 1) return;
811813
if (increment == value) return;
812814
increment = value;
815+
updateScrollBar();
813816
}
814817

815818
/**

0 commit comments

Comments
 (0)