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

Bug 99493

Summary: [Preferences] Colors and Fonts preference page opens extremely wide due to Java properties file compare text font
Product: [Eclipse Project] Platform Reporter: Billy Biggs <billy.biggs>
Component: UIAssignee: Kevin McGuire <Kevin_McGuire>
Status: VERIFIED FIXED QA Contact: Kevin McGuire <Kevin_McGuire>
Severity: normal    
Priority: P3 CC: daniel_megert, ob1.eclipse, pwebster, tomasz.zarna
Version: 3.1Flags: Kevin_McGuire: review+
emoffatt: review+
Target Milestone: 3.5 RC1   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot
none
Patch emoffatt: iplog+

Description Billy Biggs CLA 2005-06-11 00:11:51 EDT
I20050610-1757, GTK+ 2.6.4.

Window > Preferences > General > Appearance > Colors and Fonts

This preference page opens with all of the top-level items in the tree expanded.
 The width of the tree when it opens seems to be sized to be large enough to
show the full text of the longest entry, namely the ridiculously long string:

  "Java properties file compare text font
   (defaults to Properties File Editor Text Font)"

This makes the Preferences dialog resize to almost the entire width of my screen.
Comment 1 Billy Biggs CLA 2005-06-11 00:13:07 EDT
Created attachment 22856 [details]
Screenshot
Comment 2 Kim Horne CLA 2005-06-13 07:13:04 EDT
The page remembers the previous tree state but doesn't attempt to do sensible sizing.
Comment 3 Tod Creasey CLA 2006-05-01 11:23:39 EDT
Deferring
Comment 4 Tod Creasey CLA 2007-03-19 14:35:47 EDT
This is by design - it is done this way so that you are able to read without scrolling.

Having said that   "Java properties file compare text font
   (defaults to Properties File Editor Text Font)"


is pretty long. Moving to compare to see if they can shorten it
Comment 5 Michael Valenta CLA 2007-03-28 13:06:05 EDT
The "(defaults to Properties File Editor Text Font)" portion of the text appears to be appended by the preference page. Moving back to UI. 
Comment 6 Kevin McGuire CLA 2009-04-27 10:57:56 EDT
Man this looks bogus, we should fix it.
Changed OS to All since this happens on WinXP too.
Comment 7 Oleg Besedin CLA 2009-04-30 11:22:16 EDT
This affects bug 273047. Let's see if we can fix it in RCs.
Comment 8 Oleg Besedin CLA 2009-04-30 11:25:25 EDT
Created attachment 133950 [details]
Patch

The fix is similar to the fix for the bug 266018.
Comment 9 Kevin McGuire CLA 2009-05-04 15:44:04 EDT
Q: Why '175' in:

+		data.widthHint = Math.max(175, convertWidthInCharsToPixels(30));


Looks like it might be just a copy (and unintended) of the next line in the source:

         data.heightHint = Math.max(175, convertHeightInCharsToPixels(10));


175 is rather narrow and I'm not sure it's needed in practice (the other bug mentioned doesn't do a Math.max).
Comment 10 Oleg Besedin CLA 2009-05-05 10:36:30 EDT
(In reply to comment #9)
> Q: Why '175' in:
> +               data.widthHint = Math.max(175,
> convertWidthInCharsToPixels(30));

The logic was: in a clean Eclipse install that table is almost square, so I guessed that initial desired width == initial desired height, which is currently set to 175. 

If that is too small feel free to increase it. For the refence, on my computer it shows up with default width of about 300 pixels. 

I guess any number between, say, 150 and 250 will work well. The exact number is probably not important as the table will resize to fill the dialog. 
Comment 11 Kevin McGuire CLA 2009-05-05 11:29:48 EDT
(In reply to comment #10)
> (In reply to comment #9)
> > Q: Why '175' in:
> > +               data.widthHint = Math.max(175,
> > convertWidthInCharsToPixels(30));
> 
> The logic was: in a clean Eclipse install that table is almost square, so I
> guessed that initial desired width == initial desired height, which is
> currently set to 175. 
> 
> If that is too small feel free to increase it. For the refence, on my computer
> it shows up with default width of about 300 pixels. 
> 
> I guess any number between, say, 150 and 250 will work well. The exact number
> is probably not important as the table will resize to fill the dialog. 

Thanks for the explanation.  Mostly I wanted to ensure it was intentional and not a copy/paste artifact.

I'm approving the patch as is but feel free to change to a larger number if you think it warranted.  175 won't hurt and I think it'd be quite unusual for the case to be triggered anyway.

Comment 12 Eric Moffatt CLA 2009-05-06 09:19:40 EDT
+1 for me...sheesh, for a fix like this how did it stay open for almost 4 years?
Comment 13 Kevin McGuire CLA 2009-05-06 12:03:04 EDT
I'll release patch.
Comment 14 Kevin McGuire CLA 2009-05-06 12:14:54 EDT
Released
Comment 15 Paul Webster CLA 2009-05-15 08:38:46 EDT
to assign
Comment 16 Paul Webster CLA 2009-05-15 08:39:14 EDT
assigned
Comment 17 Kevin McGuire CLA 2009-05-19 15:51:47 EDT
Verified in RC1