Bug 574290 - Setting Layout hint Width to SWT.DEFAULT Leads To Layout Problems
Summary: Setting Layout hint Width to SWT.DEFAULT Leads To Layout Problems
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.21   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-18 03:08 EDT by Duc Nguyen CLA
Modified: 2021-06-18 05:30 EDT (History)
1 user (show)

See Also:


Attachments
SWT Text widget layout problems (18.64 KB, image/png)
2021-06-18 03:08 EDT, Duc Nguyen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Duc Nguyen CLA 2021-06-18 03:08:43 EDT
Created attachment 286617 [details]
SWT Text widget layout problems

There seems to be a layout problem when setting hint width to SWT.DEFAULT in combination with grab=true which e.g. for Text widgets when the text value to be displayed is too long to fit into the control.

If the control that hosts the Text widget has a horizontal scrollbar, this will cause the Text widget to grab as much space as needed to entirely display the text value - which can be very, very long. (see screenshot)

The only workaround we found is to set hint width to "0". Is there a way to still use SWT.DEFAULT or is this a bug in SWT?

Thank you in advance!

Duc