Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 40586 - [Themes] [Preferences] Problems with PreferencePage.createNoteComposite
Summary: [Themes] [Preferences] Problems with PreferencePage.createNoteComposite
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Kevin McGuire CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 28428 94681 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-22 09:19 EDT by Martin Aeschlimann CLA
Modified: 2009-04-28 21:15 EDT (History)
5 users (show)

See Also:


Attachments
Picture showing the problem (20.67 KB, image/png)
2009-02-26 02:21 EST, Dani Megert CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2003-07-22 09:19:10 EDT
M2

PreferencePage.createNoteComposite create a 'Note' remork for preference pages:

- Note does not adapt to the dialog font when changed.
e.g. set dialog font to size 14: all 'Note:' labels still have the old font

- createNoteComposite sets SWT.WRAP but the label passed is not wrapped (i guess
the width hint is required, but can't be set on the parent composite)
Comment 1 Tod Creasey CLA 2003-10-10 13:43:25 EDT
The first problem is a non issue as it does not use the dialog font - it uses 
the header font.

The composite sets using SWT.NONE - here is the code for the label

new Label(messageComposite, SWT.WRAP);
Comment 2 Martin Aeschlimann CLA 2003-10-13 07:03:44 EDT
a.) are you sure? I just set the dialog and the header font to something big 
(24 pixel). When looking at the Appearance preference page, all fonts are big, 
except the 'Note:' label.

b.) It's about the note composite I create using 'createNoteComposite': 
The 'message' that I pass in is longer and should be wrapped. Note that you are 
creating the label, not me. (line 582)

Maybe I completly misunderstood you, but I would suggest to reopen the bug. 
Comment 3 Tod Creasey CLA 2003-10-14 08:17:42 EDT
Yes - it is the banner font not the header font (sorry my mistake). Just be 
sure to close the dialog and reopen - we don't apply the fonts to other pages 
right away due to sizing problems it can create.
Comment 4 Martin Aeschlimann CLA 2003-10-15 03:37:46 EDT
It's the banner, you're right. I have to say that I would never had guessed 
that I have to change the banner code and keep it 'in sync' with the dialog 
font for the 'Note:'. So maybe tyhis is not the most optimal solution.
Couldn't you take the dialog font and make it bold? If it's already bold it 
doesn't matter.
Comment 5 Tod Creasey CLA 2003-10-15 11:39:49 EDT
No you can't as there are many fonts that have no bold value (Asian fonts for 
instance).
Comment 6 Martin Aeschlimann CLA 2003-10-15 11:41:48 EDT
My suggestion would have been to have the normal dialog font in that case.
Comment 7 Remy Suen CLA 2008-12-07 08:17:27 EST
(In reply to comment #6)
> My suggestion would have been to have the normal dialog font in that case.

I'm inclined to agree with Martin here (I just noticed this bug last night). I think it's strange that all your fonts are one size but then the one label control is another. Besides the fact that it updates itself based on the banner's font, it's currently set to start off with JFace's "default font". So first it's the default font, then if you change the banner font, your label will suddenly alter itself to the banner font.
Comment 8 Dani Megert CLA 2009-02-26 02:16:11 EST
The current solution does not work and gives a bad UI when users change their dialog font (see attached picture).
Comment 9 Dani Megert CLA 2009-02-26 02:16:28 EST
*** Bug 28428 has been marked as a duplicate of this bug. ***
Comment 10 Dani Megert CLA 2009-02-26 02:21:54 EST
Created attachment 126813 [details]
Picture showing the problem
Comment 11 Dani Megert CLA 2009-02-26 02:22:36 EST
*** Bug 94681 has been marked as a duplicate of this bug. ***
Comment 12 Boris Bokowski CLA 2009-02-26 15:27:25 EST
It does look weird when the two fonts are not in sync. Do we need an additional "bold dialog font", just for this case?
Comment 13 Dani Megert CLA 2009-02-27 02:45:10 EST
>Do we need an additional "bold dialog font", just for this case?
I think that would be overkill.

I would set the bold style on the existing dialog font and live with the case where this is not available. Another approach would be to use another font (like banner) and set the height to match the dialog font's height.
Comment 14 Kevin McGuire CLA 2009-04-23 14:18:09 EDT
(In reply to comment #13)

> I would set the bold style on the existing dialog font and live with the case
> where this is not available. Another approach would be to use another font
> (like banner) and set the height to match the dialog font's height.

I agree.  It's bad typography design to mix too many font types. Because of the proximity of the word "Note" to the rest of the text, visually the best choice is to use the same font then live with lack of bolding on some char sets.  This seems a better strategy (typographically) then picking banner or some other font and hoping they look ok side by side. 

Linda, would you agree?
Comment 15 Linda Watson CLA 2009-04-23 16:50:45 EDT
yes agree.
Comment 16 Dani Megert CLA 2009-04-24 03:15:17 EDT
Fixed in HEAD.
Available in build > N20090423-2000.

I also removed the code that updates the label's font on the fly because 99% of the preference pages don't update themselves on font change once they have been created.
Comment 17 Kevin McGuire CLA 2009-04-24 10:56:33 EDT
(In reply to comment #16)
> Fixed in HEAD.
> Available in build > N20090423-2000.

Thanks Dani.

> I also removed the code that updates the label's font on the fly because 99% of
> the preference pages don't update themselves on font change once they have been
> created.

Makes sense yes. 

Comment 18 Kevin McGuire CLA 2009-04-28 21:15:53 EDT
Verified in 0428-0100 in XP English.