Bug 483789 - [Dark Theme] Progressbar turns white on update
Summary: [Dark Theme] Progressbar turns white on update
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.7 M4   Edit
Assignee: Ian Pun CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
: 465905 (view as bug list)
Depends on:
Blocks: 497562 506553
  Show dependency tree
 
Reported: 2015-12-07 08:11 EST by Lars Vogel CLA
Modified: 2016-11-09 15:14 EST (History)
6 users (show)

See Also:


Attachments
Animated Gif (217.64 KB, image/gif)
2015-12-07 08:11 EST, Lars Vogel CLA
no flags Details
Another animated git which shows this during p2 installation (217.64 KB, image/gif)
2015-12-07 08:14 EST, Lars Vogel CLA
no flags Details
Windows 7 (94.63 KB, image/png)
2016-10-27 13:38 EDT, Markus Keller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2015-12-07 08:11:14 EST
If I start Eclipse with the dark theme the progress bar frequently turn white during an update. Looks to me that SWT does not respect the background color if it triggers an update.
Comment 1 Lars Vogel CLA 2015-12-07 08:11:54 EST
Created attachment 258478 [details]
Animated Gif
Comment 2 Lars Vogel CLA 2015-12-07 08:14:01 EST
Created attachment 258479 [details]
Another animated git which shows this during p2 installation
Comment 3 Arun Thondapu CLA 2016-05-04 08:00:20 EDT
This is still reproducible with the 4.6 M7 build but its unlikely we can investigate it for 4.6, moving the target to 4.7.
Comment 4 Lars Vogel CLA 2016-07-10 18:28:07 EDT
*** Bug 465905 has been marked as a duplicate of this bug. ***
Comment 5 Ian Pun CLA 2016-07-19 15:07:58 EDT
Color for progress bar items are set from platform.ui in ProgressInfoItem.java lines 188-195. The darkRGB values are set by acquiring  COLOR_LIST_BACKGROUND and applying a shift (in linux, the shift is -10). However, this only causes the items to look slightly darker since COLOR_LIST_BACKGROUND is 255,255,255 (white). We can change the color to match something correctly to Progress items by adjusting the shift.
Comment 6 Eric Williams CLA 2016-07-28 14:16:04 EDT
(In reply to Ian Pun from comment #5)
> Color for progress bar items are set from platform.ui in
> ProgressInfoItem.java lines 188-195. The darkRGB values are set by acquiring
> COLOR_LIST_BACKGROUND and applying a shift (in linux, the shift is -10).
> However, this only causes the items to look slightly darker since
> COLOR_LIST_BACKGROUND is 255,255,255 (white). We can change the color to
> match something correctly to Progress items by adjusting the shift.

Based on this, moving to Platform UI.
Comment 7 Ian Pun CLA 2016-09-13 16:58:10 EDT
It actually looks like setColor() is actually the culprit; ProgressInfoItem calls setColor() whenever there is an update, which overrides the dark theme css momentarily (until you refresh the widget by switching tabs). the setColor() is mainly used so that in the Progress view, there is a slight shift difference in color between different items. I think the best thing to do is to not have it set those colors if we are running dark theme (or many any theme at all besides classic?). I did a bit of research into how we could find it, and I came this method : PlatformUI.getWorkbench().getThemeManager().getCurrentTheme(), but I am not sure how to get the actual themes "name" to compare to.
Comment 8 Lars Vogel CLA 2016-09-13 17:26:46 EDT
(In reply to Ian Pun from comment #7)
> It actually looks like setColor() is actually the culprit; ProgressInfoItem
> calls setColor() whenever there is an update, which overrides the dark theme
> css momentarily (until you refresh the widget by switching tabs).

I did not look into the code, but this sounds like setColor() should not be called at all during update.
Comment 9 Ian Pun CLA 2016-09-14 09:57:12 EDT
(In reply to Lars Vogel from comment #8)
> (In reply to Ian Pun from comment #7)
> > It actually looks like setColor() is actually the culprit; ProgressInfoItem
> > calls setColor() whenever there is an update, which overrides the dark theme
> > css momentarily (until you refresh the widget by switching tabs).
> 
> I did not look into the code, but this sounds like setColor() should not be
> called at all during update.

So far, the setColor() gets called whenever theres an add or remove, pretty much any "updates" to the progress (more info, less info, removing the info completely, etc). What it is suppose to do is give the related information to a central 'job' a shift of RGB values by 10 or so, making it slightly darker. However, this feature is messing up our dark theme completely, as it doesn't take account for any themeing whatsoever. I suggest we remove the setColor() method that has to do with shifting/updating any colors except for 
'selected widget' color update. This will make any themeing work correctly as it will use the .css from org.eclipse.ui.themes as priority.
Comment 10 Lars Vogel CLA 2016-09-14 11:11:34 EDT
(In reply to Ian Pun from comment #9)
> I suggest we remove  setColor() method that has to do with shifting/updating any colors except
> for 
> 'selected widget' color update. This will make any themeing work correctly
> as it will use the .css from org.eclipse.ui.themes as priority.

+1, sounds like a good plan.
Comment 11 Eclipse Genie CLA 2016-09-14 15:01:17 EDT
New Gerrit change created: https://git.eclipse.org/r/81125
Comment 12 Eclipse Genie CLA 2016-09-19 11:17:36 EDT
New Gerrit change created: https://git.eclipse.org/r/81359
Comment 15 Lars Vogel CLA 2016-09-19 11:52:47 EDT
Thanks Ian. Can you please create an entry for the N&N M3?
Comment 16 Eclipse Genie CLA 2016-09-19 15:34:46 EDT
New Gerrit change created: https://git.eclipse.org/r/81382
Comment 17 Ian Pun CLA 2016-09-19 15:52:32 EDT
(In reply to Lars Vogel from comment #15)
> Thanks Ian. Can you please create an entry for the N&N M3?

Should be in now with some before and after photos.
Comment 19 Markus Keller CLA 2016-10-27 13:38:27 EDT
Created attachment 265087 [details]
Windows 7

This is how it looks on Windows 7 in I20161027-0700.
Comment 20 Markus Keller CLA 2016-10-27 13:46:34 EDT
Reopening. Bugs on Windows 7:

* Dark theme:
- background is red

* normal themes:
- backgrounds are not using alternating colors any more
- when changing the selection, all previously selected jobs are drawn in selection color (blue)

I'll remove the entry from the M3 N&N. If you add the entry again in M4, then please spend more time with the formatting (e.g.: <b>Progress</b> view)
Comment 21 Lars Vogel CLA 2016-10-27 14:26:47 EDT
(In reply to Markus Keller from comment #20)
> Reopening. Bugs on Windows 7:
> 
> * Dark theme:
> - background is red

Will be fix with this bug (Gerrit upcoming)

> * normal themes:
> - backgrounds are not using alternating colors any more
> - when changing the selection, all previously selected jobs are drawn in
> selection color (blue)

Handled by Bug 506553.
Comment 22 Eclipse Genie CLA 2016-10-27 14:50:09 EDT
New Gerrit change created: https://git.eclipse.org/r/84042
Comment 24 Lars Vogel CLA 2016-10-31 04:54:38 EDT
Fixed black theme issue, white theme issue will be discussed via Bug 506553.
Comment 25 Eclipse Genie CLA 2016-11-09 15:14:29 EST
New Gerrit change created: https://git.eclipse.org/r/84762