Skip to content

Commit d7a85c4

Browse files
author
zhourenjian
committed
Fixed CoolBar's layout bug
1 parent 58e802e commit d7a85c4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,7 @@ public void setWrapIndices (int [] indices) {
14911491
protected boolean SetWindowPos(Object hWnd, Object hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags) {
14921492
int lines = getVerticalLines();
14931493
int lineNo = 0, itemNo = 0;
1494-
int bw = getBorderWidth() * 2;
1494+
//int bw = getBorderWidth() * 2;
14951495
for (int i = 0; i < items.length; i++) {
14961496
CoolItem item = items[i];
14971497
if (items[i].wrap) {

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,12 @@ protected boolean SetWindowPos(Object hWnd, Object hWndInsertAfter, int X, int Y
10781078
}
10791079
item.updateItemBounds(w, h);
10801080
}
1081-
return super.SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags);
1081+
if (parent instanceof CoolBar) {
1082+
X = 0;
1083+
Y = 0;
1084+
}
1085+
boolean set = super.SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags);
1086+
return set;
10821087
}
10831088

10841089
/*

0 commit comments

Comments
 (0)