Skip to content

Commit 060515d

Browse files
author
zhourenjian
committed
Fixing bug that Firefox/2.0 does not have correct scrollbar and tray logo.
Fixing bug that mouseover tray bar does not have correct shadow.
1 parent de9be48 commit 060515d

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ public void initialize() {
8787
handle = document.createElement("DIV");
8888
handle.className = "tray-logo-item";
8989
handle.title = "Powered by Java2Script";
90+
boolean needFixing = OS.isFirefox;
91+
/**
92+
* @j2sNative
93+
* needFixing &= (navigator.userAgent.indexOf ("Firefox/2.0") != -1);
94+
*/ {}
95+
if (needFixing) {
96+
handle.style.backgroundColor = "white";
97+
}
9098
document.body.appendChild(handle);
9199
handle.onclick = new RunnableCompatibility() {
92100
public void run() {
@@ -271,6 +279,14 @@ void setZIndex(String zIdx) {
271279
item.style.zIndex = zIdx;
272280
}
273281
}
282+
if (tray.supportShadow && tray.outerShadows != null) {
283+
for (int i = 0; i < tray.outerShadows.length; i++) {
284+
Element item = tray.outerShadows[i];
285+
if (item != null) {
286+
item.style.zIndex = zIdx;
287+
}
288+
}
289+
}
274290
if (handle != null) {
275291
handle.style.zIndex = zIdx;
276292
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,12 @@ protected void createVerticalScrollBar(Element parent, int sbOuterHeight, int sb
265265
sbHandle.style.width = (sbWidth + 1) + "px";
266266
sbHandle.style.marginLeft = "-1px";
267267
} else {
268-
sbHandle.style.width = sbWidth + "px";
268+
boolean needFixing = OS.isFirefox;
269+
/**
270+
* @j2sNative
271+
* needFixing &= (navigator.userAgent.indexOf ("Firefox/2.0") != -1);
272+
*/ {}
273+
sbHandle.style.width = (sbWidth + (needFixing ? 0.1 : 0)) + "px";
269274
}
270275
sbHandle.style.height = sbOuterHeight + "px";
271276
outerHandle.appendChild(sbHandle);

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,19 @@ static String trayLineColor(int line) {
9090
private void addTrayLine () {
9191
cellLines++;
9292
String lineColor = trayLineColor (cellLines);
93+
boolean needFixing = cellLines == 1 && OS.isFirefox;
94+
/**
95+
* @j2sNative
96+
* needFixing &= (navigator.userAgent.indexOf ("Firefox/2.0") != -1);
97+
*/ {}
9398
for (int i = 0; i < cellLines; i++) {
9499
Element cell = document.createElement ("DIV");
95100
cell.className = "tray-cell";
96101
cell.style.left = ((cellLines - 1 - i) * 36) + "px";
97102
cell.style.top = (i * 36) + "px";
103+
if (i == 0 && needFixing) {
104+
cell.style.visibility = "hidden";
105+
}
98106
cell.style.borderColor = lineColor + " transparent transparent transparent";
99107
if (OS.isIENeedPNGFix) { // IE < 6.0
100108
cell.style.borderRightColor = "rgb(0,255,0)";

0 commit comments

Comments
 (0)