Community
Participate
Working Groups
When PaneFolder in its method layout() calculates bounds of topRight and topCenter elements, it uses coordinates of titleArea. These coordinates are absolute, while bounds of topRight and topCenter controls should be relative to their parent. In case when parent is rtl-oriented, results of this calculation are wrong. The following changes can solve this problem: ... boolean isRTL = (viewForm.getStyle() & SWT.RIGHT_TO_LEFT) != 0; //bidi Rectangle topRightArea = new Rectangle(titleArea.x + (isRTL? 0 : titleArea.width - topRightSize.x),titleArea.y //bidi + (titleArea.height - topRightSize.y) / 2, topRightSize.x, topRightSize.y); if (topRight != null) { topRight.setBounds(Geometry.toControl(topRight.getParent(), topRightArea)); } if (topCenter != null) { Rectangle topCenterArea = new Rectangle(topRightArea.x + (isRTL? topRightArea.width : //bidi - topCenterSize.x), titleArea.y + (titleArea.height - topCenterSize.y) / 2, topCenterSize.x, topCenterSize.y); Rectangle localCoords = Geometry.toControl(topCenter .getParent(), topCenterArea); topCenter.setBounds(localCoords); } ...
Created attachment 30929 [details] PaneFolder with wrong layout
Michael, we should consider this for 3.1.2, do you agree?
This bug and bug 109868 may be the same problem.
Paul, do you know if there is a better way to layout the pane folder, rather than having conditional code that checks if we are using RTL orientation? i.e. is there a way to calculate the layout using the same code rather than using one calculation if we are in a bidi locale and another if we are in an LTR locale? Copying Eric too, as he has dealt with Bidi layout issues in the past.
There should be. I'm looking at the code now but haven't quite figured it out yet...;-). There's some suspicious code in the layout that use 'Geometry.toContol() that code looks like it presumes that the 'from' coords are display units (Display.map's 'from' control is null). This is known to cause problems in RTL because the desktop's coords are never mirrored...I'll look into it some more.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.