Project

General

Profile

Bug #3672

Clean up AF3 toolbar layout

Added by Simon Barner over 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
-
Start date:
03/12/2019
Due date:
% Done:

100%

Estimated time:
1.00 h

Description

The AF3 toolbar has several layout issues (see af3-2018-12-zoom-gui-glitch.PNG)

  • Zoom control squeezed (at least on Windows)
  • Spurious previous/next annotation controls (this has been confirmed on Linux in a Photon-based developer installation)
af3-2018-12-zoom-gui-glitch.PNG (58.5 KB) af3-2018-12-zoom-gui-glitch.PNG Simon Barner, 03/12/2019 04:16 PM
toolbar-layout-bug-windows.PNG (19.8 KB) toolbar-layout-bug-windows.PNG Simon Barner, 10/02/2019 08:41 AM
toolbar-layout-bug-ubuntu-16.04-LTS.PNG (42 KB) toolbar-layout-bug-ubuntu-16.04-LTS.PNG Simon Barner, 10/02/2019 05:33 PM

Related issues

Related to Bug #3216: Current/upcoming objective comboboxes not centeredRejected12/06/2017

History

#1 Updated by Simon Barner over 1 year ago

  • Related to Bug #3216: Current/upcoming objective comboboxes not centered added

#2 Updated by Johannes Eder over 1 year ago

  • Target version changed from AF3 2.15 RC1 (Feature Freeze) to AF3 2.16 RC1 (Feature Freeze)

#3 Updated by Johannes Eder over 1 year ago

  • Target version changed from AF3 2.16 RC1 (Feature Freeze) to AF3 2.16 RC2 (Tested, Bug-free)

#4 Updated by Alexander Diewald about 1 year ago

  • Priority changed from Normal to High

#5 Updated by Alexander Diewald almost 1 year ago

  • Assignee changed from Alexander Diewald to Simon Barner
  • % Done changed from 0 to 100
  • Estimated time set to 1.00 h

Fixed. MRs:
Kernel: https://git.fortiss.org/af3/kernel/merge_requests/69
RCP: https://git.fortiss.org/af3/af3-rcp/merge_requests/7

Could you review this one, please? Otherwise, just assign it back to me :)

#6 Updated by Alexander Diewald almost 1 year ago

  • Status changed from New to Resolved

#7 Updated by Simon Barner 12 months ago

The layout is broken on Windows (also with a fresh runtime workspace). See screenshot attached.

#8 Updated by Alexander Diewald 12 months ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Alexander Diewald to Anonymous

Cutting of the combobox still occurs, but it is not noticable any more. The height of the ToolBar can be adjusted with hacks to override the ToolbarManager and Toolbar classes, but this causes mis-alignments of buttons, while the contained controls are still cut.

Resolved by using a CCombo.

#9 Updated by Alexander Diewald 12 months ago

  • Assignee changed from Anonymous to Simon Barner

#10 Updated by Simon Barner 12 months ago

On Ubuntu 16 LTS, the comboboxes hide several important toolbar buttons (e.g., the save button).

#11 Updated by Simon Barner 12 months ago

Layout is ok now on Ubuntu 16. However, I get the following exception when opening the ComboBox. Maybe additional cast errors exist:

STACK 0
java.lang.ClassCastException: class org.eclipse.swt.custom.CCombo cannot be cast to class org.eclipse.swt.widgets.Combo (org.eclipse.swt.custom.CCombo and org.eclipse.swt.widgets.Combo are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @2aa27288)
    at org.fortiss.af3.rcp.application.advisors.CurrentObjectiveContributionItem$1.widgetSelected(CurrentObjectiveContributionItem.java:133)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5874)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1400)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1426)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1409)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1198)
    at org.eclipse.swt.custom.CCombo.listEvent(CCombo.java:1177)
    at org.eclipse.swt.custom.CCombo.lambda$0(CCombo.java:119)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5874)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1400)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5138)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4663)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:635)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.fortiss.af3.rcp.application.AF3Application.start(AF3Application.java:49)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1441)

#12 Updated by Alexander Diewald 12 months ago

  • Status changed from In Progress to Feedback
  • Assignee changed from Alexander Diewald to Simon Barner

I'd declare the zoom bar issue a won't fix. Latest tries can be found in the kernel branch.

While the Objective boxes somewhat work now after hours, the problem with the zoom box looks unfixable: Either we accept that the height of the box is ~5px, or we don't have the drop down arrow. The reason for this behaviour is found in ZoomComboContributionItemFixed, line 219. The constructor of the ToolItem accepts a SWT flag. Using SWT.SEPARATOR causes the first layout bug, using SWT.DROP_DOWN the second one. Since I did not find any way to influence this behaviour elsewhere, I would consider this just broken as the bug occurs deep within SWT native platform code.
It seems like the SWT-based framework supports only very primitive use cases... even for its own (broken) classes.

#13 Updated by Simon Barner 12 months ago

  • Assignee changed from Simon Barner to Alexander Diewald

toolitem = new ToolItem(parent, SWT.SEPARATOR | SWT.DROP_DOWN, index); seems to improve the situation. However, I do not know how to increase the height of the CCombo.

#14 Updated by Alexander Diewald 12 months ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Alexander Diewald to Simon Barner

Zoom box problem remains in Windows. Unfixable without modifying platform-specific SWT code.

Just for the record:
toolitem = new ToolItem(parent, SWT.SEPARATOR | SWT.DROP_DOWN, index);
shows the same behaviour as using
toolitem = new ToolItem(parent, SWT.SEPARATOR, index);
alone.

#15 Updated by Simon Barner 12 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Simon Barner to Alexander Diewald

Just let me know when this can be merged...

#16 Updated by Alexander Diewald 12 months ago

  • Assignee changed from Alexander Diewald to Simon Barner

Current status: The zoom box only works under linux after opening a second editor... Got there with some hacks.

However, there is no hope at all to fix this without spending hours or days of work (Windows is even more broken).
I vote for removing the box from the menu and just rely on CTRL+MouseWheel. This stuff is utterly broken upstream without any chance of being fixed some time.

#17 Updated by Alexander Diewald 12 months ago

  • Status changed from Feedback to Resolved

Tip of branch removes the zoom box. Zoom functionality is still there.

#18 Updated by Simon Barner 12 months ago

  • Status changed from Resolved to Closed
  • Assignee deleted (Simon Barner)

Merged. An alternative zoom control shall be implemented in #3843.

Below a copy of the attempt to fix the height of the zoom toolbar item that fixed the height (but not the behavior, see comment 16) on Linux.

/** Overwrites {@link ZoomComboContributionItem} to fix the height adjustment of the zoom combo box. */
public class ZoomComboContributionItemFixed extends ZoomComboContributionItem {

    /** See {@link ZoomComboContributionItem#ZoomComboContributionItem(IPartService)}. */
    public ZoomComboContributionItemFixed(IPartService partService) {
        super(partService);
    }

    /** See {@link ZoomComboContributionItem#ZoomComboContributionItem(IPartService, String)}. */
    public ZoomComboContributionItemFixed(IPartService partService, String initString) {
        super(partService, initString);
    }

    /** See {@link ZoomComboContributionItem#ZoomComboContributionItem(IPartService, String[])}. */
    public ZoomComboContributionItemFixed(IPartService partService, String[] initStrings) {
        super(partService, initStrings);
    }

    /** {@inheritDoc} */
    @Override
    protected Control createControl(Composite parent) {
        Control control = super.createControl(parent);
        parent.setSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT));
        return control;
    }
}

Also available in: Atom PDF