Skip to content

Commit c36d64d

Browse files
author
zhourenjian
committed
Adjust Shell's size and fix a bug that errors occurs when new Shells are created
1 parent 72a1795 commit c36d64d

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,10 @@ public Rectangle computeTrim (int x, int y, int width, int height) {
395395
x -= 4;
396396
y -= 4;
397397
} else {
398-
width += 4;
399-
height += 4;
400-
x -= 2;
401-
y -= 2;
398+
width += 6;
399+
height += 6;
400+
x -= 3;
401+
y -= 3;
402402
}
403403
}
404404
// System.err.println( new Rectangle (x, y, width, height));
@@ -2366,16 +2366,16 @@ protected boolean SetWindowPos(Object hWnd, Object hWndInsertAfter, int X, int Y
23662366
height -= 4;
23672367
cx -= 4;
23682368
cy -= 4;
2369-
int dw = 6;
2370-
int dh = 6;
2369+
int dw = 4;
2370+
int dh = 4;
23712371
// if ((style & SWT.BORDER) != 0) {
23722372
// dw -= 2;
23732373
// dh -= 2;
23742374
// }
23752375
contentHandle.style.height = ((height - dh >= 0) ? height - dh : 0) + "px";
23762376
contentHandle.style.width = (width - dw > 0 ? width - dw : 0) + "px";
2377-
contentHandle.style.top = 2 + "px";
2378-
contentHandle.style.marginRight = 1 + "px";
2377+
contentHandle.style.top = 3 + "px";
2378+
contentHandle.style.left = 1 + "px";
23792379
}
23802380
if ((style & SWT.BORDER) != 0) {
23812381
cx -= 4;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
border-style:solid solid solid none;
1313
border-width:1px;
1414
border-height:buttonshadow;
15-
opacity:0.25;
16-
filter:Alpha(Opacity=25);
15+
/*opacity:0.25;
16+
filter:Alpha(Opacity=25);*/
1717
}
1818
.shell-item, a.shell-item {
1919
display:block;
@@ -27,8 +27,8 @@
2727
background-color:buttonface;
2828
border:1px solid buttonshadow;
2929
color:buttontext;
30-
opacity:0.55;
31-
filter:Alpha(Opacity=55);
30+
/*opacity:0.55;
31+
filter:Alpha(Opacity=55);*/
3232
}
3333
.shell-item:hover, a.shell-item:hover {
3434
opacity:0.85;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ sm.updateItems = function () {
346346
var item = this.items[i];
347347
item.itemHandle.style.top = offset + (i * hh + 24) + "px";
348348
if (item.shell != null && item.shell.getText () != item.text) {
349-
for (var j = item.textHandle.childNodes.length; j >= 0; j--) {
349+
for (var j = item.textHandle.childNodes.length - 1; j >= 0; j--) {
350350
item.textHandle.removeChild (item.textHandle.childNodes[j]);
351351
}
352352
item.textHandle.appendChild (document.createTextNode (item.shell.getText ()));

0 commit comments

Comments
 (0)