| Summary: | Colors and Fonts preference page: Reset is broken | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Markus Keller <markus.kell.r> | ||||||||
| Component: | UI | Assignee: | Dani Megert <daniel_megert> | ||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P2 | CC: | daniel_megert, jessev | ||||||||
| Version: | 3.7 | ||||||||||
| Target Milestone: | 3.7 M6 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 399345 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Markus Keller
I'll take a look. This is an old problem not introduced by the latest changes to the page. The state of the fonts isn't correctly maintained. 'Restore Defaults' is broken as well. And of course same for colors. Created attachment 181818 [details]
Fix
Markus, can you please test and review the patch? Thanks. There were two other issues: 1. preview is also broken 2. other direction is also broken Fixed this in HEAD (ColorsAndFontsPreferencePage.java rev. 1.73). Available in builds > I20101027-1300. From what I could understand of that code, the final fix (1.73) looks good, except for a wrong dispose() call that I've removed in 1.74. Argh! It now works in the dialog but once an override is applied one can no longer get rid of it. Created attachment 181917 [details]
Additional Fix
Created attachment 181926 [details]
Additional Fix
Regression compared to I20101005-0800:
- start with default settings
- set "Java editor text font" to bold
- set "Java compare text font" to bold-italic
- save preferences (OK, reopen)
- reset "Java compare text font"
=> preview and label for "Java compare text font" look OK, but when preferences are saved, the "Java compare text font" is a custom font that matches the "Text Font".
Changing resetFont(..) to do
fontPreferencesToSet.put(definition.getId(), newFD);
solves this problem but brings back comment 0.
Remaining problems (were already broken in I20101005-0800):
A:
- start with default settings
- set "Java compare text font" to bold
- set "Java editor text font" to bold
- reset "Java editor text font"
=> "Java compare text font" says it overrides, but label and preview look like it doesn't override
=> After storing the change and reopening the dialog, the "Java compare text font" is bold again (and overrides)
B:
- start with default settings
- set "Java compare text font" to bold
- set "Java editor text font" to bold
- save preferences (OK, reopen)
- Restore Defaults
=> labels and preview look OK
=> After storing the change and reopening the dialog, the "Java compare text font" is bold again (and overrides)
The way the page stores the stuff into the preference store can only be fixed with a bigger rewrite. At this point the safest thing to use the mechanism we used in M2 and 3.6 and take a closer look during M4. Fixed in ColorsAndFontsPreferencePage.java, rev. 1.76. Available in builds >= I20110210-2000. Altering fonts/styles seem to be working correctly. However, changing text color doesn't seem to have an effect on either the preview or in an editor after being saved. - If you change the Java Editor Text Font color to something other than black, it says that it overrides the default, but it will appear the same as the default in the preview and in the editor after being saved. Options to change JUST colors (and not the font) seems to work fine though (eg. changing content assist color works fine). I've opened a new bug for this -> https://bugs.eclipse.org/bugs/show_bug.cgi?id=339283 Woops! Seems the color controls shouldn't even be in the dialog anyway, and the bug was marked as a duplicate. Sorry about that. Verified in build I20110307-2110. Everything looks good. |