Community
Participate
Working Groups
Created attachment 254800 [details] screenshot I have a simple menu contribution extension that contributes a tool bar to the Trim. The toolbar has a single control that displays an Icon. However the toolbar is cropped and is placed lower than other toolbars. It does not look like the control is to blame but rather the complete toolbar (see attachment). The provided example works well in Luna. This affects tools such as https://code.google.com/a/eclipselabs.org/p/workspacemechanic. Example: <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> <extension id="test.ext.1" point="org.eclipse.ui.menus"> <menuContribution allPopups="false" locationURI="toolbar:org.eclipse.ui.trim.status"> <toolbar id="test.toolbar.1" label="Test toolbar"> <control class="test.MyWorkbenchWindowControlContribution" id="test.toolbar.ctrl.1"> </control> </toolbar> </menuContribution> </extension> </plugin> public class MyWorkbenchWindowControlContribution extends WorkbenchWindowControlContribution { @Override protected Control createControl(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); FillLayout layout = new FillLayout(); comp.setLayout(layout); Label control = new Label(comp, SWT.CENTER); control.setEnabled(true); Image image = PlatformUI.getWorkbench().getSharedImages() .getImage(org.eclipse.ui.ide.IDE.SharedImages.IMG_OBJ_PROJECT); control.setImage(image); return comp; }
Works as expected on -os macosx -ws cocoa -arch x86_64
I am seeing the same thing. Trims contributed as menuContributions in Mars do not show up correctly on Windows.
The toolbar gets created with the correct height if you contribute a command to it as its first child. This is why the Mylyn active task trim works correctly (org.eclipse.mylyn.internal.tasks.ui.TaskTrimWidget).
Yes, the icon is positioned correctly if a command is contributed to the toolbar. The command must have a label to display some text.
I have the same problem on Windows 8.1 - apparently the toolbar height is set to 7 pixels if there is no command in it. I did not find any workaround other than adding a "dummy" command that functions as "label".
Hi, I have the same problem on Windows 10. Our contributions contain Text field and the fact that as they are cropped as a real impact... I will try the workaround until a better solution. Regards
You may want to check the Windows forums...AFAIK this is baked in to the windows toolbars (i.e. I've never been able to find a fix...;-).
This works correctly in Eclipse 3.8 (and I think also in 4.2).
I confirm that it's working with a Luna RCP application on windows 10, and not with a Mars RCP application, on the same OS. Moreover, the workaround which consists on adding a command in the toolbar is working.
Confirm, the control contribution not worked on windows 7 with eclipse mars rcp application.
Mass move to 4.7 as M7 is approaching. Please move back in case you are planning to fix it for Neon.
After also running into this issue on Eclipse Mars I've used the workaround described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=471313 It boils down to: public class MyWorkbenchWindowControlContribution extends WorkbenchWindowControlContribution { @Override protected Control createControl(Composite parent) { parent.getParent().setRedraw(true); .... } @Override public boolean isDynamic() { return true; }
(In reply to Maarten Verburg from comment #12) Thank you Maarten for posting the workaround, it worked on Windows 7 and Neon.
*** Bug 466609 has been marked as a duplicate of this bug. ***
*** Bug 471326 has been marked as a duplicate of this bug. ***
If someone has a patch, we have only few days left to integrate it into 4.7. I haven't tried this, but there seem to be a reproducer application in bug 471326 (see https://bugs.eclipse.org/bugs/attachment.cgi?id=254802).
*** Bug 516021 has been marked as a duplicate of this bug. ***
Encountered the same issue here on windows 10. in 4.4.2 this was still going fine. in 4.6.1 this issue occurred. This workaround from Maarten Verburg seems to solve the problem for now. Thanks!
This problem is occurring on the HiDPI environment. > Labels are cut off in Windows when at 200% scale on HiDPI. > https://github.com/cypher256/eclipse-encoding-plugin/issues/10
The workaround does not fix the problem in the HiDPI environment.
Rolf, can you have a look?
*** Bug 517775 has been marked as a duplicate of this bug. ***
*** Bug 465732 has been marked as a duplicate of this bug. ***
(In reply to Lars Vogel from comment #21) > Rolf, can you have a look? Lars, I had a look, but probably the issue is in SWT as the 'fix' doesn't make sense to me. The following change resolves the issue, in ToolBarManger#update, change the finally the code below. The duplication is not a mistake, it does fix it. } finally { toolBar.setRedraw(true); toolBar.setRedraw(true); }
(In reply to Rolf Theunissen from comment #24) > (In reply to Lars Vogel from comment #21) > > Rolf, can you have a look? > > Lars, I had a look, but probably the issue is in SWT as the 'fix' doesn't > make sense to me. > > The following change resolves the issue, in ToolBarManger#update, change the > finally the code below. The duplication is not a mistake, it does fix it. > > } finally { > toolBar.setRedraw(true); > toolBar.setRedraw(true); > } That looks weird. Please move to SWT.
This bug is caused/uncovered the by changes in Bug 457214. On windows it seems that the current setRedraw calls in ToolBarManager can be removed all together. Especially after Bug 90757 is fixed, which should reduce flickering.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/167774
The issue occurs in SWT toolbar when there are only separators with controls, the style of the toolbar is wrapped, and redraw is disabled. These conditions are met in ToolBarManager. The following SWT code reproduces the issue. public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setLayout (new FillLayout()); ToolBar tb1 = new ToolBar (shell, SWT.WRAP); tb1.setRedraw(false); for (int i = 0; i < 4; i++) { Button b = new Button(tb1, SWT.PUSH); b.setText("Button" + i); b.pack(); ToolItem ti = new ToolItem (tb1, SWT.SEPARATOR); ti.setWidth (b.getSize().x); ti.setControl (b); } tb1.setRedraw(true); shell.pack (); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); }
Just to confirm the bug is still there with 2021-12. On Windows, a control in the status bar is truncated. We tried the workaround of #12 and it is improving the situation on normal screens. On HiDPI screen it is better, but still truncated. I will attach screenshots.
Created attachment 288148 [details] What the rendering is on Linux or MacOSX
Created attachment 288149 [details] The rendering on Windows without workaround
Created attachment 288150 [details] The rendering on Windows HiDPI with workaround