Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 266018

Summary: ColorsAndFontsPreferencePage should set widthHint in createDescriptionControl
Product: [Eclipse Project] Platform Reporter: Mike Wilson <Mike_Wilson>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: greensopinion
Version: 3.5   
Target Milestone: 3.5 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch to set the width hint. none

Description Mike Wilson CLA 2009-02-24 15:13:10 EST
To see the current behavior, do:
1) Open Preferences Dialog
2) Select General -> Appearance -> Colors and Fonts
3) Select "View and Editor Folders" -> Part title font
4) Close Preferences Dialog
5) Open Preferences Dialog

Notice that at this point the dialog has resized to be very wide. This is caused because the "Description:" text for this entry is very wide and no width hint has been provided on the text control. A simple fix would be to just set the width hint to something reasonable, but as usual it's non-trivial to figure out what that should be -- N characters? 1/4 the current Screen width?...

I'll attach a patch that just sizes it based on an approx. 30 character width.
Comment 1 Mike Wilson CLA 2009-02-24 15:16:33 EST
Created attachment 126606 [details]
Patch to set the width hint.

Example patch. There is probably a smarter way to pick a width value.
Comment 2 Boris Bokowski CLA 2009-03-03 16:24:20 EST
We have this problem on all preference pages with long descriptions. Is there not a way to fix this in a generic way, for all preference pages?
Comment 3 Mike Wilson CLA 2009-03-03 21:13:31 EST
Tackling the general problem would be hard. We're unlikely to be able to guess what a reasonable size for all possible preference pages is.
Comment 4 Boris Bokowski CLA 2009-03-06 16:13:05 EST
(In reply to comment #1)
> Created an attachment (id=126606) [details]
> Patch to set the width hint.
> 
> Example patch. There is probably a smarter way to pick a width value.
> 

Smart enough for me, given that we derive the height hint in the same way.
Comment 5 Boris Bokowski CLA 2009-04-15 13:21:20 EDT
*** Bug 264726 has been marked as a duplicate of this bug. ***