Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 168738 - ProgressBar does not respect user-defined foreground colors.
Summary: ProgressBar does not respect user-defined foreground colors.
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Bogdan Gheorghe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 168580
  Show dependency tree
 
Reported: 2006-12-20 12:00 EST by Paul Slauenwhite CLA
Modified: 2007-02-19 14:37 EST (History)
1 user (show)

See Also:


Attachments
ProgressBarColorTest.java (5.47 KB, application/octet-stream)
2006-12-20 12:27 EST, Paul Slauenwhite CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Slauenwhite CLA 2006-12-20 12:00:42 EST
[Windows Vista] ProgressBar does not respect user-defined foreground colors.

Using the enclosed sample on Microsoft Windows Vista (Beta), user-defined forground colors (e.g. org.eclipse.swt.widgets.ProgressBar#setForeground(org.eclipse.swt.graphics.Color)) are not updated in the progress bar.  Instead, the progress bar remains the default system color (e.g. lime green).
Comment 1 Paul Slauenwhite CLA 2006-12-20 12:27:33 EST
Created attachment 55981 [details]
ProgressBarColorTest.java
Comment 2 Paul Slauenwhite CLA 2007-01-15 09:04:09 EST
Is there any status on this defect?

Increasing severity since this defect is the result of a broken API.
Comment 3 Kevin Haaland CLA 2007-01-24 10:01:29 EST
This defect was submitted to wrong component. Moving to SWT
Comment 4 Steve Northover CLA 2007-01-31 08:09:18 EST
Kevin, can you try this out?  I believe that this is a Windows limitation.  The progress bar does not respect colors on XP as well.
Comment 5 Paul Slauenwhite CLA 2007-01-31 08:15:26 EST
(In reply to comment #4)

We see the same symptoms on Linux (x86) as well.  For example, SLES and Fedora.
Comment 6 Kevin Barnes CLA 2007-01-31 10:20:21 EST
According to the win32 documentation the PBM_SETBARCOLOR Message is only supported in the Windows Classic Theme.
Bogdan can you investigate gtk?
Comment 7 Bogdan Gheorghe CLA 2007-01-31 11:27:48 EST
GTK uses the progress bar pic that is specified by the current theme. Setting the foreground color on the progress bar will not change the bar color. Switching themes will change the color.
Comment 8 Paul Slauenwhite CLA 2007-01-31 11:32:32 EST
Is there a way to programmatically achieve the same effect as XP (e.g. changing the color of the progress bar) on Vista and Linux?
Comment 9 Kevin Barnes CLA 2007-01-31 11:59:24 EST
There is no fix for this. The native widgets don't allow for their color to be changed.

Note that XP doesn't allow you to change the color of a progress bar either (unless you are using the classic theme)
Comment 10 Paul Slauenwhite CLA 2007-02-19 14:37:14 EST
Thanks for the information. 

Moving forward, can this limitation be documented in the class header comment or on the FAQ?