Community
Participate
Working Groups
Build 200207161002 1. Run the attached test case. 2. Size the window slightly smaller horizontally so that the Open Type (last cool item) gets wrapped to the next row. Notice that the first cool item on the first row is resized bigger. Also notice how flashy the auto wrapping is as you size the window smaller. You can actually see the items being moved to the left than back to the right.
Created attachment 1733 [details] test case jar
All this flash is because there are two resize listeners on the CoolBar. One is the GridLayout added to the composite and another is a extra resize listener. Looks like the first listener resize the CoolBar bigger causing the item move to the right and then the second listener resize the CoolBar smaller again causing the item return to the left. Try change to example like this: a) Get rid of the extra resizeListener b) Replace the GridLayout on the composite by a FillLayout
Lynne, the same behavior can be verified on IE. There are no SWT code doing or causing this. It's a platform behavior. Note that when the coolbar is resized bigger again all the coolitem return the correct size. Reopen this pr in case I have misunderstood something.
This bug causes a problem when you resize the window for Perspective "A" smaller, which causes the coolitems to wrap and be sized incorrectly as this PR indicates, and then switch to another perspective. As part of switching to another perspective, the coolbar layout is saved for Perspective "A" (including the incorrect cool item sizes). When you switch back to Perspective "A", which restores the saved coolbar layout, and resize the window larger, the coolitems are NOT returned to their correct size since the layout was saved with the incorrect sizes. I don't see how I can work around this.
For the flashing on the coolbar we already have Bug17994. About the problem retrieving the sizes I can't help, the API getSizes is doing what it is suppose to do: returns the current size of coolitems. Probably the fix for you would be throw away the sizes if the workbench is resized or if the coolbar wraps. Anyway, Eclipse 3.0 always reset the coolbar size in perspective switch so this is no longer a problem.