Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 284409 - [DateTime] Up/down buttons misaligned when widget is larger than preferred size
Summary: [DateTime] Up/down buttons misaligned when widget is larger than preferred size
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.3   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 2.2 M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-23 08:15 EDT by Ralf Sternberg CLA
Modified: 2013-10-21 11:46 EDT (History)
2 users (show)

See Also:


Attachments
Screenshot (7.48 KB, image/png)
2009-07-23 08:16 EDT, Ralf Sternberg CLA
no flags Details
Proposed patch (4.32 KB, text/plain)
2009-07-29 04:32 EDT, Asen Draganov CLA
rsternberg: iplog+
Details
Editor rendered the first time. Everything is fine (57.36 KB, image/png)
2013-10-16 07:55 EDT, Steffen Eichenberg CLA
no flags Details
Editor rendered the second time. Buttons positions are wrong. (57.54 KB, image/png)
2013-10-16 07:58 EDT, Steffen Eichenberg CLA
no flags Details
A modal dialog has been opened. Editor seems to relayout correctly (55.80 KB, image/png)
2013-10-16 08:02 EDT, Steffen Eichenberg CLA
no flags Details
Demo Code for the DateTime layout bug (7.48 KB, application/x-zip-compressed)
2013-10-21 08:23 EDT, Steffen Eichenberg CLA
no flags Details
Patch against 2.1-maintenance branch (4.45 KB, patch)
2013-10-21 11:45 EDT, Ivan Furnadjiev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Sternberg CLA 2009-07-23 08:15:21 EDT
The up/down buttons are placed next to the input field, even when there is more space, see attached screenshot.
Comment 1 Ralf Sternberg CLA 2009-07-23 08:16:03 EDT
Created attachment 142373 [details]
Screenshot
Comment 2 Asen Draganov CLA 2009-07-29 04:32:56 EDT
Created attachment 142859 [details]
Proposed patch

The patch fixes also the vertical sizing of up/down buttons when widget is higher than preferred size (there was a different behavior compared with SWT).
Comment 3 Ralf Sternberg CLA 2009-08-06 08:05:55 EDT
Applied patch to CVS HEAD.
Comment 4 Steffen Eichenberg CLA 2013-10-16 06:27:09 EDT
I would like to reopen the bug. At least the horizontal positioning of the up/down buttons is wrong with RAP 2.1.x, when the widget size is larger than the preferred size.

The behaviour is eratic. The first time a page is rendered, the buttons are placed correctly. The second time the page renders, the buttons are placed next to the input fields. When opening a modal dialog, the buttons jump back to the right.

This has been tested with RAP 2.1.1 in IE10, Chrome30 and FF24.
Comment 5 Ivan Furnadjiev CLA 2013-10-16 06:49:42 EDT
(In reply to Steffen Eichenberg from comment #4)
> I would like to reopen the bug. At least the horizontal positioning of the
> up/down buttons is wrong with RAP 2.1.x, when the widget size is larger than
> the preferred size.
> 
> The behaviour is eratic. The first time a page is rendered, the buttons are
> placed correctly. The second time the page renders, the buttons are placed
> next to the input fields. When opening a modal dialog, the buttons jump back
> to the right.
> 
> This has been tested with RAP 2.1.1 in IE10, Chrome30 and FF24.

Could you provide a screenshot to visualize the problem?
Comment 6 Steffen Eichenberg CLA 2013-10-16 07:55:08 EDT
Created attachment 236532 [details]
Editor rendered the first time. Everything is fine
Comment 7 Steffen Eichenberg CLA 2013-10-16 07:58:56 EDT
Created attachment 236533 [details]
Editor rendered the second time. Buttons positions are wrong.

- The user logged out from the application, i.e. the EntryPoint.createUI() method terminates.
- The user creates a new Session by entering the EntryPoint.createUI() method a second time. Now the editor is not rendered correctly.
Comment 8 Steffen Eichenberg CLA 2013-10-16 08:02:36 EDT
Created attachment 236534 [details]
A modal dialog has been opened. Editor seems to relayout correctly

- Starting with the wrong positioning of the up/down Buttons, the user opened a modal dialog (YesNoDialog). When opening the dialog, the UI seems to refresh. Now the buttons are again at their correct position.

You can repeat the loop of the last two screenshots (logout-login, dialog).
Comment 9 Steffen Eichenberg CLA 2013-10-16 08:03:57 EDT
Screenshots added

- Step 1: Editor rendered the first time. Everything is fine
- Step 2: Editor rendered the second time. Buttons positions are wrong.
- Step 3: A modal dialog has been opened. Editor seems to relayout correctly
Comment 10 Ivan Furnadjiev CLA 2013-10-16 08:11:54 EDT
(In reply to Steffen Eichenberg from comment #9)
> Screenshots added
> 
> - Step 1: Editor rendered the first time. Everything is fine
> - Step 2: Editor rendered the second time. Buttons positions are wrong.
> - Step 3: A modal dialog has been opened. Editor seems to relayout correctly

I will reopen the bug.
Comment 11 Ivan Furnadjiev CLA 2013-10-17 04:17:59 EDT
Steffen, I can't reproduce it with our Examples Demo and RAP from master. Could you create a simple snippet/project that demonstrate the issue?
Comment 12 Ivan Furnadjiev CLA 2013-10-17 09:17:19 EDT
Steffen, which layout is used for DateTime sizing in the faulty screenshot?
Comment 13 Steffen Eichenberg CLA 2013-10-17 10:18:30 EDT
The layout is a GridLayout with GridData.grabHorizontal=true.

We are working on a small demo. The error does not occur in the controls demo. It *seems* to only occur when using perspectives, the control being in an EditorPart and the EditorPart having a ToolBar (build by a contributor and using ToolBarManager). Everything works fine, as long as the editor does not have a ToolBar. But we observed this only in a bigger context. Now we are trying to dumb that down the the absolute necessary parts.
Comment 14 Ivan Furnadjiev CLA 2013-10-17 11:22:21 EDT
Waiting for your snippet...
Comment 15 Steffen Eichenberg CLA 2013-10-21 08:23:47 EDT
Created attachment 236705 [details]
Demo Code for the DateTime layout bug

It took us some time to isolate this unexpected behavior. Our application is fairly complex, with parts coming from a framework and other parts coming from product development.

The code contains two entry points. The first entry point demonstrates the behavior in a simple shell, the second in a workbench (we wanted to know if there are any differences). The behavior can be observed in both cases.

- start the application
- in case of workbench entry point, press the button in the left view to open an editor
- DateTime renders fine
- press the "Refresh me" button. Rendering is wrong.
- press the "Dialog me" button. A dialog opens. In the background the DateTime is rendered correctly again. This works exactly one time after server restart!

You can find the UI and the layouts in the class datetimeproject.TestUI.
Comment 16 Ivan Furnadjiev CLA 2013-10-21 11:32:39 EDT
Thanks for the snippet. Fixed in master with commit eeac61878a868975493ee635249cc9e2fa42c97a.
Comment 17 Ivan Furnadjiev CLA 2013-10-21 11:45:19 EDT
Created attachment 236724 [details]
Patch against 2.1-maintenance branch