Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355709 - Labels are cut off in certain circumstances (StackLayout, width hints)
Summary: Labels are cut off in certain circumstances (StackLayout, width hints)
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5 M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: sr141?
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 10:24 EDT by Stefan Berkmiller CLA
Modified: 2011-08-26 08:26 EDT (History)
0 users

See Also:


Attachments
Here's a screenshot which shows the cut off label (38.95 KB, image/png)
2011-08-24 10:25 EDT, Stefan Berkmiller CLA
no flags Details
And he're the associated demo project (48.04 KB, application/x-zip-compressed)
2011-08-24 10:26 EDT, Stefan Berkmiller CLA
no flags Details
Proposed patch for v14_Maintenance branch (12.65 KB, patch)
2011-08-25 14:23 EDT, Ivan Furnadjiev CLA
rsternberg: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Berkmiller CLA 2011-08-24 10:24:37 EDT
Build Identifier: 20110615-0604

We're developing a RAP application with CSS themeing and some complex layouts. A strange behavior occurs: Some labels are ALWAYS cut off (e.g. "Nan" instead of "Name").

This happens on multiple platforms and multiple Browsers (Windows 7 with current versions of IE, Firefox and Chrome, iPad 2 with Safari). Only Ubuntu with Firefox did not have the problem. We contacted Ralf Sternberg and he also did not have that issue when running the sample project.

The strange thing is: The label is only cut off the first time. If you reload the page, everything is alright. But we also had the problem that some labels were always rendered too short.

Attached is a screenshot and a sample. We believe that something is wrong in RAP when labels are inside a component which has a width hint and which is in a StackLayout.

Reproducible: Always

Steps to Reproduce:
1. Import project
2. Set target platform
3. Run as RAP application

Note: If you want to reproduce the problem again, you must restart the RAP application!!!
Comment 1 Stefan Berkmiller CLA 2011-08-24 10:25:19 EDT
Created attachment 202089 [details]
Here's a screenshot which shows the cut off label
Comment 2 Stefan Berkmiller CLA 2011-08-24 10:26:03 EDT
Created attachment 202090 [details]
And he're the associated demo project
Comment 3 Ivan Furnadjiev CLA 2011-08-24 11:44:05 EDT
I can reproduce it with RAP 1.4 and CVS HEAD.
Comment 4 Ivan Furnadjiev CLA 2011-08-24 13:12:48 EDT
This issue is related to width hint only. In case of width hint, the size of the Composite is not changed during the TextSizeDetermination "enlargement", thus the layout is not performed on it. I remember such a bug already opened, but I can't find it anymore.
Comment 5 Ivan Furnadjiev CLA 2011-08-24 14:55:27 EDT
The problem is in the Composite#notifyResize. In the original SWT Composite#sendResize method there is no check for a different size. Removing this check fixes the problem and there is no failing tests. I'll try to come with a JUnit test for it.
Comment 6 Ivan Furnadjiev CLA 2011-08-24 15:33:13 EDT
(In reply to comment #5)
> In the original SWT Composite#sendResize method there is no check for a different size.
I was wrong - the check for different size is done in Composite#setBounds ( if (wasResized && !isDisposed ()) sendResize (); )
Comment 7 Ivan Furnadjiev CLA 2011-08-25 14:23:03 EDT
Created attachment 202170 [details]
Proposed patch for v14_Maintenance branch
Comment 8 Ivan Furnadjiev CLA 2011-08-25 14:26:33 EDT
Applied patch to CVS HEAD. Fixed by marked composite layout for recalculation in TextSizeRecalculation.
Comment 9 Ralf Sternberg CLA 2011-08-25 14:37:29 EDT
Comment on attachment 202170 [details]
Proposed patch for v14_Maintenance branch

Looks all right to me. +1 to apply this patch to the 1.4 maintenance branch.
Comment 10 Ivan Furnadjiev CLA 2011-08-25 15:27:05 EDT
Applied patch to v14_Maintenance branch.
Comment 11 Ivan Furnadjiev CLA 2011-08-25 16:40:37 EDT
Applied patch to Tree_Table_Merge branch too.
Comment 12 Stefan Berkmiller CLA 2011-08-26 08:15:06 EDT
We checked out the nightly build and ran out app with it. The issue really seems to be solved. We're looking forward to the 1.4.1 release.

Thanks a lot.

PS: Did you have to change the plugin.xml? The <themeContribution> doesn't work anymore in out project (theme id could not be found). We changed to a normal <theme> to try it out.
Comment 13 Ivan Furnadjiev CLA 2011-08-26 08:26:02 EDT
(In reply to comment #12)
> PS: Did you have to change the plugin.xml? The <themeContribution> doesn't work
> anymore in out project (theme id could not be found). We changed to a normal
> <theme> to try it out.
I opened a Bug 355723 for the theme contribution issue.