Community
Participate
Working Groups
Created attachment 212541 [details] Screenshot of Quick Access dop-down When starting to type in the "Quick Access" field, a drop-down with matching items appears. Only the width is way wider than necessary. See the attached screenshot. Reproducible with 4.2 M5
*** Bug 351474 has been marked as a duplicate of this bug. ***
There doesn't seem to be a problem with the actual window sizing. The shell size is persisted with a default of 350 wide (which is quite reasonable). You can resize the popup shell to be more reasonable. I suspect anyone reusing a workspace from 3.x will see a much larger popup as the same dialog settings id was used. If we are concerned about this, simply changing the dialog settings constant would fix it. However, the positioning of the popup leaves something to be desired. Unlike context menus and popup menu's, the quick access shell does not respect the edge of my monitor or attempt to open inside the parent shell. Several jface methods to do the sizing/positioning were copied into SearchField. I will try to modify these methods to be a little smarter.
Here is a possible improvement, replacing layoutShell() in SearchField with the following improves the placement to use more of the shell space. void layoutShell() { Display display = text.getDisplay(); Rectangle tempBounds = text.getBounds(); Rectangle compBounds = display.map(text, null, tempBounds); int preferredWidth = dialogWidth == -1 ? 350 : dialogWidth; int width = Math.max(preferredWidth, compBounds.width); int height = dialogHeight == -1 ? 250 : dialogHeight; // If size would extend past the right edge of the shell, try to move it // to the left of the text Rectangle shellBounds = text.getShell().getBounds(); if (compBounds.x + width > shellBounds.x + shellBounds.width){ compBounds.x = Math.max(shellBounds.x, (compBounds.x + compBounds.width - width)); } shell.setBounds(getConstrainedShellBounds(display, new Rectangle(compBounds.x, compBounds.y + compBounds.height, width, height))); shell.layout(); }
(In reply to comment #3) > Here is a possible improvement, replacing layoutShell() in SearchField with the Testing in windows and I found that the loadDialog / storeDialog methods that actually save / restore the sizings are only called when the workbench starts and shuts down. Feels like we need to call loadDialog each time time the widget will show and storeDailog each time the widget will hide. My two cents.
(In reply to comment #4) > (In reply to comment #3) > > Here is a possible improvement, replacing layoutShell() in SearchField with the > > Testing in windows and I found that the loadDialog / storeDialog methods that > actually save / restore the sizings are only called when the workbench starts > and shuts down. Feels like we need to call loadDialog each time time the widget > will show and storeDailog each time the widget will hide. My two cents. Perhaps we should toast the asyncExec in checkFocusLost? I removed it and the dialog is much more responsive on Win7 and the sizings started working.
(In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #3) > > > Here is a possible improvement, replacing layoutShell() in SearchField with the > > > > Testing in windows and I found that the loadDialog / storeDialog methods that > > actually save / restore the sizings are only called when the workbench starts > > and shuts down. Feels like we need to call loadDialog each time time the widget > > will show and storeDailog each time the widget will hide. My two cents. > > Perhaps we should toast the asyncExec in checkFocusLost? I removed it and the > dialog is much more responsive on Win7 and the sizings started working. It would also be very cool if you could tab from the text box to the shell...
Curtis, sorry...I was unaware that there was so much shared code. For my money I'd forget how it's currently being done and simply save the location and size info in the MToolControl's 'persistentData' field... That will make the timing of the current save / restore no longer relevant...
Fix for positioning: https://github.com/mrennie/eclipse.platform.ui/commit/eedb494743dfe13161780167422fd1bb5dc7f4cd This fix corrects the positioning and clarifies the code in a few places that caused a lot of confusion while debugging. I still haven't reproduced the sizing issue in linux so I will have to do some additional testing in Windows. Eric, if you see the resizing again, please take a guess at steps.
> It would also be very cool if you could tab from the text box to the shell... This is possible using a traverse listener, but in practice is useless since the arrow keys, enter and escape already work. > Testing in windows and I found that the loadDialog / storeDialog methods that > actually save / restore the sizings are only called when the workbench starts > and shuts down. Feels like we need to call loadDialog each time time the widget > will show and storeDailog each time the widget will hide. My two cents. As the shell is not closing when focus is lost, there is no need to write out the dialog settings. The fields should be good enough. The way the code is structured certainly leaves something to be desired. So this is a good candidate for refactoring in the future. > Perhaps we should toast the asyncExec in checkFocusLost? I removed it and the > dialog is much more responsive on Win7 and the sizings started working. Without the async, the popup will fail to close on focus lost as the focus event needs time to complete. I made a few attempts to find an alternative that would be faster, but each attempt caused the shell to close unexpectedly (bad) or stay open indefinitely (really bad).
(In reply to comment #9) > > It would also be very cool if you could tab from the text box to the shell... > > This is possible using a traverse listener, but in practice is useless since > the arrow keys, enter and escape already work. > Yeah, once I realized the up / down arrow keys worked like that, the tab key use is bogus. I tested the changes in the branch and they work fine for me on Win7 x64.
Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=6dc76888d658c49d74d3379448b4259625d075f8 Thanx Curtis, PW
verified in Version: 4.2.0 Build id: I20120430-1800