Bug 220642 - [open type] Open Type dialog does not work in high contrast
Summary: [open type] Open Type dialog does not work in high contrast
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 3.4   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords: accessibility
: 220644 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-27 14:20 EST by Kim Horne CLA
Modified: 2008-05-02 16:13 EDT (History)
3 users (show)

See Also:


Attachments
Open Type dialog (16.55 KB, image/png)
2008-02-27 14:20 EST, Kim Horne CLA
no flags Details
screenshot (45.41 KB, image/png)
2008-02-29 11:43 EST, Martin Aeschlimann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kim Horne CLA 2008-02-27 14:20:44 EST
Created attachment 90915 [details]
Open Type dialog

1) go to Control Panel-Accessibilty->Display and enable high contrast mode
2) open eclipse
3) ctrl-shift-t to open the open type dialog

expected result: I can read the contents of the list

result: the list renders with black text on a black background. I can only read the text when I select an item.
Comment 1 Dani Megert CLA 2008-02-28 06:52:28 EST
Can reproduce in I20080226-1155.

Caused by colored labels. Same bug in 3.3.x but there colored labels are off by default.
Comment 2 Martin Aeschlimann CLA 2008-02-29 11:43:29 EST
Created attachment 91209 [details]
screenshot

In I20080226-1155 I see a slightly different error, see screenshot.

The selected element is a non-focused table viewer has foreground and background color black.

This seems to work with tree viewer (screenshot shows package explorer that also uses the StyledCellLabelProvider) and seems to work for table viewers with focus.

that's whats happening in StyledCellLabelProvider.paint(..):

boolean applyColors = (event.detail & SWT.SELECTED) == 0
GC gc = event.gc;
...		
if (applyColors) {
  Color foreground= cell.getForeground();
  if (foreground != null) {
	gc.setForeground(foreground);
  }
			
  Color background= cell.getBackground();
  if (background != null) {
	gc.setBackground(background);
  }
}

...
textLayout= constructed text layout, only text, no styles
textLayout.draw(gc, x, y);

That means in the case of no selection, I don't set any colors but rely that the GC has the right colors set for the scenario (selected item/ no focus)
- I that the correct assumption? 
- Is there a way to get the selection/non-focus colors?

Moving to SWT for comments.
Comment 3 Steve Northover CLA 2008-04-29 11:51:44 EDT
Windows has a bug where it doesn't draw with the selection color in high contrast mode when focus is not in the control.
Comment 4 Steve Northover CLA 2008-04-29 12:26:25 EDT
Fixed > 20080429

I fixed this for custom draw table and trees.  The native table has a bug that I'm going to work around (captured by bug 220646).
Comment 5 Boris Bokowski CLA 2008-05-02 16:13:32 EDT
*** Bug 220644 has been marked as a duplicate of this bug. ***