archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
952 stars 268 forks source link

Text alignment is not set after appearance box is scrolled down with mouse wheel #1053

Closed lvmm closed 3 months ago

lvmm commented 3 months ago

Version of Archi

5.3.0

Archi Plug-ins

no

Operating System

windows 10

Expected Behaviour

clicking on text alignment icons should change text alignment of the selected element

Actual Behaviour

After appearance tab of properties window is scrolled down with mouse wheel, first click on a text alignment icon doesn't change text alignment of the selected element but scrolls the appearance tab instead. This happens only if mouse wheel is used for scrolling, keyboard and scrollbar scrolling are not affected.

Steps to Reproduce the Behaviour

prerequisites: properties window height is not sufficient to display appearance tab completely, scrolling is required to get to its bottom

  1. open properties-appearance of an element, select appearance tab and and scroll to the the bottom with excessive use of mouse wheel
  2. try changing text alignment by clicking on any of the alignment icons
Phillipus commented 3 months ago

I can't reproduce this at all. I'm on Windows 11, though. Please check if the same behaviour happens on other installations in case it is a hardware or configuration issue.

Phillipus commented 3 months ago

Actually I can reproduce it if I click on the last text position button. No idea why this happens. Might be an Eclipse bug.

Phillipus commented 3 months ago

Nothing to do with the scroll wheel or the text alignment button:

  1. Select an ArchiMate element in a View
  2. Select the Appearance tab
  3. Scroll to the bottom either with the mouse wheel or the scrollbars
  4. Select a different ArchiMate element in the View
  5. Click anywhere in the lower white space of the Appearance tab
  6. The tab scrolls upwards

Seems that when clicking somewhere in the tab or even on the "Appearance" tab itself again the focus jumps upwards. This is something in the Eclipse framework so I can't fix this. Needs more investigation.

Phillipus commented 3 months ago

Actually it's part of the accessibility of controls.

See https://github.com/eclipse-platform/eclipse.platform.ui/blob/7011d80af6f74738adef50f3e7f8c0f73548e32d/bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/FormToolkit.java#L449-L499

Note:

     * @param trackFocus
     *            if <code>true</code>, form will be scrolled horizontally
     *            and/or vertically if needed to ensure that the control is
     *            visible when it gains focus. Set it to <code>false</code> if
     *            the control is not capable of gaining focus.

The controls in the tabs set this to true. I can set it to false and this fixes the jumping problem, but I don't know how this affects accessibility.

Phillipus commented 3 months ago

This problem is a side effect of accessibility support.

The idea is that a user can select a control in the pane and then use the Tab key (or Shift-Tab key combination) to move through the controls. When a control gains the focus it is scrolled into view if it is not visible. If the trackFocus option is set to false then the control will not scroll into view and this is bad for accessibility.

The original problem is caused by scrolling to the bottom of the controls in the pane, moving the focus away by clicking elsewhere, and then clicking in the pane again. The focus is then set to the first control in the pane and this causes the pane to try to scroll up.

I'm sorry but I can't change this because of these reasons, so I'll close this.

lvmm commented 3 months ago

No, my scenario is different: no clicking elsewhere; just scrolling down and trying to select the control which, by the way, is fully visible, so there is no reason to scroll the view, is enough. BTW on linux it is even weirder - the pane is scrolled all the way to the top, so the control actually becomes invisible, and two text positions get selected at once.

before: Screenshot_20240702_211731 after clicking just once and scrolling back down to see results: Screenshot_20240702_211946

Phillipus commented 3 months ago

No, my scenario is different: no clicking elsewhere; just scrolling down and trying to select the control

The cause is exactly the same. Selecting the control puts the focus on the pane. It's not handled well by the Eclipse framework but, as I said, I can't turn off the accessibility option.

lvmm commented 3 months ago

Uh... I don't see how control jumping all over the place and disappearing from the the screen can help people with disabilities whatever they are. Maybe a global option in setup to turn accessibility framework on or off?

Phillipus commented 3 months ago

Uh... I don't see how control jumping all over the place and disappearing from the the screen can help people with disabilities whatever they are. Maybe a global option in setup to turn accessibility framework on or off?

Accessibility is not just about people with disabilities, it's also about providing UI access with a keyboard instead of a mouse. I've explained why this is happening, and this side effect is one of the issues with the Eclipse framework.