Skip to content

Commit 44845c5

Browse files
author
zhourenjian
committed
Reset line-height CSS
Fixed bug that Label with SWT.SEPERATOR Fixed bug that Image is not yet loaded is not correctly computed in CTabFolder
1 parent bbfa396 commit 44845c5

File tree

8 files changed

+17
-8
lines changed

8 files changed

+17
-8
lines changed

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/graphics/GC.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3797,9 +3797,9 @@ public void setBackgroundPattern (Pattern pattern) {
37973797
}
37983798

37993799
void setClipping(int clipRgn) {
3800+
/*
38003801
int hRgn = clipRgn;
38013802
int gdipGraphics = data.gdipGraphics;
3802-
/*
38033803
if (gdipGraphics != 0) {
38043804
if (hRgn != 0) {
38053805
int region = Gdip.Region_new(hRgn);

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/graphics/Image.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,9 @@ public Rectangle getBounds() {
12041204
return null;
12051205
}
12061206
*/
1207+
if (width == 0 || height == 0) {
1208+
return new Rectangle(0, 0, 16, 16);
1209+
}
12071210
return new Rectangle(0, 0, width, height);
12081211
}
12091212

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/internal/browser/OS.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ private static void init() {
185185
s.width = "3000px";
186186
s.height = "100px";
187187
s.overflow = "scroll";
188+
s.lineHeight = "16px"; // or "1", reset CSS
188189
invisibleContainer = el;
189190
setTextSelection(el, false);
190191

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ public void run() {
675675
}
676676
handle = document.createElement("DIV");
677677
handle.className = "shell-default shell-trim";
678+
handle.style.lineHeight = "16px"; // or "1", reset CSS
678679
handle.style.visibility = "hidden";
679680

680681
//nextWindowLocation();

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -675,20 +675,20 @@ void createHandle() {
675675
*/
676676
if ((style & SWT.SHADOW_IN) != 0) {
677677
handle.className += " shadow-in";
678-
} else if ((style & SWT.SHADOW_OUT) != 0) {
679-
handle.className += " shadow-out";
680-
} else {
678+
} else if ((style & SWT.SHADOW_NONE) != 0) {
681679
handle.className += " shadow-none";
680+
} else {
681+
handle.className += " shadow-out";
682682
}
683683
handle.style.fontSize = "0";
684684
Element seperator1 = document.createElement("DIV");
685685
Element seperator2 = document.createElement("DIV");
686-
if ((style & SWT.VERTICAL) != 0) {
687-
seperator1.className = "label-seperator-vertical-left";
688-
seperator2.className = "label-seperator-vertical-right";
689-
} else {
686+
if ((style & SWT.HORIZONTAL) != 0) {
690687
seperator1.className = "label-seperator-horizontal-top";
691688
seperator2.className = "label-seperator-horizontal-bottom";
689+
} else {
690+
seperator1.className = "label-seperator-vertical-left";
691+
seperator2.className = "label-seperator-vertical-right";
692692
}
693693
handle.appendChild(seperator1);
694694
handle.appendChild(seperator2);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public void initialize() {
8888
Element tbc = document.createElement("DIV");
8989
tbc.className = "shell-manager-topbar-container";
9090
document.body.appendChild(tbc);
91+
tbc.style.lineHeight = "16px"; // or "1", reset CSS
9192
tbc.style.display = "none";
9293
this.handle = tbc;
9394

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ public void run() {
187187
}
188188
if (existed) {
189189
defaultQuickLaunch = this;
190+
} else {
191+
handle.style.display = "none";
190192
}
191193
}
192194

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ public void initialize() {
462462
return;
463463
Element sb = document.createElement("DIV");
464464
sb.className = "shell-manager-sidebar";
465+
sb.style.lineHeight = "16px"; // or "1", reset CSS
465466
sb.style.display = "none";
466467
document.body.appendChild(sb);
467468
this.handle = sb;

0 commit comments

Comments
 (0)