Bug 118802 - [Presentations] [BiDi] Layout of PaneFolder with rtl-oriented contents doesn't work properly.
Summary: [Presentations] [BiDi] Layout of PaneFolder with rtl-oriented contents doesn'...
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-12-01 06:58 EST by Semion Chichelnitsky CLA
Modified: 2019-09-06 15:37 EDT (History)
5 users (show)

See Also:


Attachments
PaneFolder with wrong layout (16.17 KB, image/gif)
2005-12-01 07:00 EST, Semion Chichelnitsky CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Semion Chichelnitsky CLA 2005-12-01 06:58:40 EST
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);
    }
...
Comment 1 Semion Chichelnitsky CLA 2005-12-01 07:00:39 EST
Created attachment 30929 [details]
PaneFolder with wrong layout
Comment 2 Karice McIntyre CLA 2005-12-07 11:33:11 EST
Michael, we should consider this for 3.1.2, do you agree?
Comment 3 Karice McIntyre CLA 2005-12-07 17:37:38 EST
This bug and bug 109868 may be the same problem.
Comment 4 Karice McIntyre CLA 2006-06-13 16:21:00 EDT
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.
Comment 5 Eric Moffatt CLA 2006-06-14 18:49:50 EDT
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.

Comment 6 Eclipse Webmaster CLA 2019-09-06 15:37:53 EDT
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.