Community
Participate
Working Groups
In Build 200404131323, all the next/previous editor/view/perspective popups have a tiny size and scrollbars which make them VERY uncomfortable to use.
This is still here in RC4 - is anything going to be done for this for 3.0? Its a pretty glaring bug - especially if you only have a few files open, then the scrollbars hide the name of the file on the bottom of the list. On windows there are no scorllbars on these popups.
maybe we can consider using a slightly larger height for these by default
oops.. edited wrong bug
patch to CyclePartAction: Index: CyclePartAction.java ============================================================ ======= RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ CyclePartAction.java,v retrieving revision 1.49 diff -u -r1.49 CyclePartAction.java --- CyclePartAction.java 26 Apr 2004 18:49:10 -0000 1.49 +++ CyclePartAction.java 22 Jun 2004 19:25:33 -0000 @@ -24,6 +24,7 @@ import org.eclipse.swt.events.MouseListener; import org.eclipse.swt.events.TraverseEvent; import org.eclipse.swt.events.TraverseListener; +import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; @@ -366,9 +367,15 @@ tc.pack(); table.pack(); Rectangle tableBounds = table.getBounds(); + Rectangle tableClientArea = table.getClientArea(); + int scrollbarheight = tableBounds.height - tableClientArea.height - table.getHeaderHeight(); + tableBounds.height += scrollbarheight; tableBounds.height = Math.min(tableBounds.height, table.getItemHeight() * MAX_ITEMS); table.setBounds(tableBounds); + tc.setWidth(table.getClientArea().width); + dialog.pack(); + dialog.setSize(dialog.getSize().x , dialog.getSize().y + scrollbarheight); tc.setWidth(table.getClientArea().width); table.setFocus();
simple test for table bounds. import org.eclipse.swt.SWT; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; /* * Created on Jun 23, 2004 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ /** * @author MVM * * TODO To change the template for this generated type comment go to Window - * Preferences - Java - Code Style - Code Templates */ public class TableTest { /** * */ public TableTest() { } public static void main(String[] args) { final int MAX_ITEMS = 22; Display display = new Display(); Shell parent = new Shell(display, SWT.SHELL_TRIM); parent.setSize(555,555); parent.open(); final Shell dialog = new Shell(parent, SWT.MODELESS); dialog.setLayout(new FillLayout()); final Table table = new Table(dialog, SWT.SINGLE | SWT.FULL_SELECTION); table.setHeaderVisible(true); table.setLinesVisible(true); TableColumn tc = new TableColumn(table, SWT.NONE); tc.setResizable(false); tc.setText("Views"); for (int i = 0; i < 5; i++) { TableItem item = new TableItem(table, SWT.NONE); item.setText("Package Explorer" + i); } int tableItemCount = table.getItemCount(); table.setSelection(0); tc.pack(); table.pack(); Rectangle tableBounds = table.getBounds(); tableBounds.height = Math.min(tableBounds.height, table.getItemHeight() * MAX_ITEMS); table.setBounds(tableBounds); dialog.pack(); tc.setWidth(table.getClientArea().width); System.out.println("Before table bounds -> " + table.getBounds ()); System.out.println("Before table client area -> " + table.getClientArea()); table.setFocus(); table.addFocusListener(new FocusListener() { public void focusGained(FocusEvent e) { // Do nothing } public void focusLost(FocusEvent e) { dialog.close(); } }); Rectangle dialogBounds = dialog.getBounds(); Rectangle displayBounds = display.getClientArea(); Rectangle parentBounds = dialog.getParent().getBounds(); //Place it in the center of its parent; dialogBounds.x = parentBounds.x + ((parentBounds.width - dialogBounds.width) / 2); dialogBounds.y = parentBounds.y + ((parentBounds.height - dialogBounds.height) / 2); if (!displayBounds.contains(dialogBounds.x, dialogBounds.y) || !displayBounds.contains( dialogBounds.x + dialogBounds.width, dialogBounds.y + dialogBounds.height)) { //Place it in the center of the display if it is not visible //when placed in the center of its parent; dialogBounds.x = (displayBounds.width - dialogBounds.width) / 2; dialogBounds.y = (displayBounds.height - dialogBounds.height) / 2; } try { dialog.open(); System.out.println("Before table bounds -> " + table.getBounds()); System.out.println("Before table client area -> " + table.getClientArea()); while (!dialog.isDisposed()) if (!display.readAndDispatch()) display.sleep(); } finally { if (!dialog.isDisposed()) dialog.close(); } while (!parent.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
I applied the patch, but it didn't seem to help. The popup window is still not taking into account the prescence of a scrollbar, and thus the scrollbar is hiding the last entry in the list. The scrollbars are present even when a single editor with a short name (Foo.java) is open.
as a workaround, modified the following two lines in CyclePartAction OLD dialogBounds.height = dialogBounds.height + 3 table.getHorizontalBar().getSize().y; NEW dialogBounds.height = dialogBounds.height + 5; dialogBounds.width = dialogBounds.width + 3;
Had to do the following to get it exactly right: dialogBounds.height = dialogBounds.height + 14;
Created attachment 12739 [details] new version of CyclePartAction
That works pretty good. Only problem is that now there is a white area at the bottom of the popup - i.e. now the popup is too big =) Hating me yet? =)
the extra area is because the table is slightly inconsistent in it's sizing on some platforms you don't know whether there will/will not be scrollbars. the next patch is less hokey. trying it on all platforms now.
fixed in HEAD, reviewed with TC, tested on GTK, MOTIF, Win XP, MacOS
FYI, I just fetched Head (org.eclipse.ui.workbench only) and tried it out, but the white area still seems to be there. If you fixed this in some other plugin, then let me know and I'll give it a shot, if not, then I figured I'd let you know that its not completely fixed.
nope, the white area is a known issue that is not going to be solved by this patch. The scrollbars cutting off text is. Thanks for your help and quick reviews here.
*** Bug 61262 has been marked as a duplicate of this bug. ***
Ok, this fix is still a major improvement over the way it was before - the white area is pretty trivial as defects go, so I'm happy with whats there, thanks. =) Glad I could help.
verified on build I20040624 on MOTIF
verified on GTK