Skip to content

Commit 1537c7a

Browse files
niraj-modiEcljpseB0T
authored andcommitted
Bug 576218 - Over 99 tab indicator has lost the +
Change-Id: Icaaf906bc43ca6cdc530aa4fad5cc1cbfa548e95 Signed-off-by: Niraj Modi <[email protected]> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/185837 Reviewed-by: Jörg Kubitz <[email protected]> Tested-by: Platform Bot <[email protected]>
1 parent 49a938b commit 1537c7a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,16 @@ protected void checkSubclass () {
192192
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
193193
}
194194

195+
@Override
196+
public void layout (boolean changed) {
197+
checkWidget ();
198+
// If changed, discard the cached layout information
199+
if (changed) {
200+
_count = _wHint = _hHint = -1;
201+
}
202+
super.layout(changed);
203+
}
204+
195205
@Override Point computeSizeInPixels (int wHint, int hHint, boolean changed) {
196206
int count = (int)OS.SendMessage (handle, OS.TB_BUTTONCOUNT, 0, 0);
197207
if (count == this._count && wHint == this._wHint && hHint == this._hHint) {

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolItem.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2017 IBM Corporation and others.
2+
* Copyright (c) 2000, 2021 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -739,6 +739,12 @@ public void setImage (Image image) {
739739
checkWidget();
740740
if ((style & SWT.SEPARATOR) != 0) return;
741741
if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
742+
boolean changed = true;
743+
// check if image size really changed for old and new images
744+
if (super.image != null && !super.image.isDisposed() && image != null && !image.isDisposed()) {
745+
changed = !super.image.getBounds().equals(image.getBounds());
746+
}
747+
parent.layout(changed);
742748
super.setImage (image);
743749
updateImages (getEnabled () && parent.getEnabled ());
744750
}

0 commit comments

Comments
 (0)