Bug 564885 - [Dark] Toolbar has a white line
Summary: [Dark] Toolbar has a white line
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.17   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 4.18 RC1   Edit
Assignee: Sravan Kumar Lakkimsetti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 565920 566212 567127 567613 569179 (view as bug list)
Depends on:
Blocks: 565691
  Show dependency tree
 
Reported: 2020-07-03 02:43 EDT by Karsten Thoms CLA
Modified: 2021-08-26 08:57 EDT (History)
16 users (show)

See Also:


Attachments
Screen Recording (1.37 MB, image/gif)
2020-07-03 02:43 EDT, Karsten Thoms CLA
no flags Details
swt-unselected-tabs-color without gradient color (1.40 MB, image/png)
2020-11-18 05:54 EST, Lakshmi P Shanmugam CLA
no flags Details
Screen shot of Light Theme toolbar (22.84 KB, image/png)
2020-11-21 14:01 EST, Phil Beauvoir CLA
no flags Details
Screen shot of System Theme toolbar (20.57 KB, image/png)
2020-11-21 14:02 EST, Phil Beauvoir CLA
no flags Details
screenshot of toolbar in ubuntu 20 (49.44 KB, image/png)
2020-11-23 03:28 EST, Sravan Kumar Lakkimsetti CLA
no flags Details
Screen shot of Light Theme toolbar on latest I build (126.81 KB, image/png)
2020-11-25 05:32 EST, Phil Beauvoir CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2020-07-03 02:43:51 EDT
Created attachment 283491 [details]
Screen Recording

After switching to dark mode in my runtime workspace and restart, a white line is shown behind toolbar items. It is even moving when the window is resized.
See attached screen recording.
Comment 1 Ingo Mohr CLA 2020-07-04 16:47:05 EDT
Hi Karsten,

I have 4.17 integration build I20200704-0600 on my Mac (Catalina 10.15.5; Java 14.0.1) and I cannot reproduce your problem with the Outline view's toolbar as shown in your attached gif.
Maybe, your problem had been fixed, meanwhile.

Can anyone confirm and add a link to the corresponding ticket?
Comment 2 Mike Marchand CLA 2020-07-04 17:39:10 EDT
The number of bugs from CTabFolder toolbar CSS really points to a fundamental API/Contract problem.  Myself and others have tried so many band-aid fixes. Maybe the Eclipse team and SWT team should come together on this topic and come up with a fool proof plan. 

All my investigations into this have proven that there is conflict between the CSS and the standard SWT calls for setForeground and setBackground calls.
Comment 3 Andrew Obuchowicz CLA 2020-07-04 20:26:44 EDT
(In reply to Mike Marchand from comment #2)
> The number of bugs from CTabFolder toolbar CSS really points to a
> fundamental API/Contract problem.  Myself and others have tried so many
> band-aid fixes. Maybe the Eclipse team and SWT team should come together on
> this topic and come up with a fool proof plan. 

+1
Comment 4 Amit Mendapara CLA 2020-07-05 02:38:34 EDT
Unable to reproduce on Linux. So it should be macOS specific only.

IMO, swt should support transparent background via CSS to solve many of such issues. I can see many components in eclipse with lots of nested swt widgets. For example, toolbars in CTabFolder.
Comment 5 Lars Vogel CLA 2020-08-20 05:45:41 EDT
*** Bug 566212 has been marked as a duplicate of this bug. ***
Comment 6 Lars Vogel CLA 2020-08-20 05:55:03 EDT
Moving to SWT as I cannot reproduce this on Linux and Win.
Comment 7 Lakshmi P Shanmugam CLA 2020-10-21 09:11:39 EDT
*** Bug 567613 has been marked as a duplicate of this bug. ***
Comment 8 Lakshmi P Shanmugam CLA 2020-11-09 05:26:32 EST
Can someone please suggest which css files should I look into to investigate this issue? Any ideas on where the white line is coming from will be very helpful.
Comment 9 Lakshmi P Shanmugam CLA 2020-11-12 04:55:04 EST
*** Bug 567127 has been marked as a duplicate of this bug. ***
Comment 10 Lakshmi P Shanmugam CLA 2020-11-12 04:56:56 EST
(In reply to Lakshmi P Shanmugam from comment #8)
> Can someone please suggest which css files should I look into to investigate
> this issue? Any ideas on where the white line is coming from will be very
> helpful.
@Lars, can you please help here?
Comment 11 Lars Vogel CLA 2020-11-12 05:06:52 EST
(In reply to Lakshmi P Shanmugam from comment #10)
> (In reply to Lakshmi P Shanmugam from comment #8)
> > Can someone please suggest which css files should I look into to investigate
> > this issue? Any ideas on where the white line is coming from will be very
> > helpful.
> @Lars, can you please help here?

I don't see the white line neither on Linux nor Windows so I don't think it comes in general from the CSS files. If you remove the plugin.xml restriction for the dark theme from Linux (oss) and switch to the dark theme from Linux on Mac do you also see the white line?
Comment 12 Lakshmi P Shanmugam CLA 2020-11-12 06:19:09 EST
(In reply to Lars Vogel from comment #11)
> (In reply to Lakshmi P Shanmugam from comment #10)
> > (In reply to Lakshmi P Shanmugam from comment #8)
> > > Can someone please suggest which css files should I look into to investigate
> > > this issue? Any ideas on where the white line is coming from will be very
> > > helpful.
> > @Lars, can you please help here?
> 
> I don't see the white line neither on Linux nor Windows so I don't think it
> comes in general from the CSS files. If you remove the plugin.xml
> restriction for the dark theme from Linux (oss) and switch to the dark theme
> from Linux on Mac do you also see the white line?

Thanks Lars. 
I tested with different themes. The problem seems related to theming, it doesn't happen when Eclipse theming is disabled.
Happens with Dark and System theme, doesn't happen with Light and Classic theme on Mac. Happens when I use linux dark theme css on Mac too.
Comment 13 Lars Vogel CLA 2020-11-12 06:31:22 EST
(In reply to Lakshmi P Shanmugam from comment #12) 
> Thanks Lars. 
> I tested with different themes. The problem seems related to theming, it
> doesn't happen when Eclipse theming is disabled.

If theming is disabled, no color call happens on the toolbar and related composites, so I assume we are seeing a SWT bug here triggered by one of the color calls in the theme. The CSS engine only calls setBackground / Foreground etc on the widget. 


> Happens with Dark and System theme, doesn't happen with Light and Classic
> theme on Mac. Happens when I use linux dark theme css on Mac too.

Does it happen in the SWT test view if you set the background / foreground color of the toolbar / toolbar container? 

You could also try the PDE "Layout spy" via Ctrl+3 which colors the container elements randomly.
Comment 14 Ingo Mohr CLA 2020-11-14 11:02:29 EST
*** Bug 565920 has been marked as a duplicate of this bug. ***
Comment 15 Lakshmi P Shanmugam CLA 2020-11-18 05:54:00 EST
Created attachment 284801 [details]
swt-unselected-tabs-color without gradient color

(In reply to Lars Vogel from comment #13)
> (In reply to Lakshmi P Shanmugam from comment #12) 
> > Thanks Lars. 
> > I tested with different themes. The problem seems related to theming, it
> > doesn't happen when Eclipse theming is disabled.
> 
> If theming is disabled, no color call happens on the toolbar and related
> composites, so I assume we are seeing a SWT bug here triggered by one of the
> color calls in the theme. The CSS engine only calls setBackground /
> Foreground etc on the widget. 
> 
> 
> > Happens with Dark and System theme, doesn't happen with Light and Classic
> > theme on Mac. Happens when I use linux dark theme css on Mac too.
> 
> Does it happen in the SWT test view if you set the background / foreground
> color of the toolbar / toolbar container? 
> 
> You could also try the PDE "Layout spy" via Ctrl+3 which colors the
> container elements randomly.

Thanks Lars.

This seems to be caused by setting the gradient background for CTabfolder.
In org.eclipse.ui.themes/css/dark/e4-dark_tabstyle.css, line 35, when I remove the gradient background color in swt-unselected-tabs-color, the white line doesn't appear.

I changed:
swt-unselected-tabs-color: '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%; 

to 

swt-unselected-tabs-color: '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START'

But, this causes all tabs to be drawn with same color and min/max are also different. Please see attached screenshot.
Comment 16 Phil Beauvoir CLA 2020-11-18 06:01:00 EST
The white line is visible using the "Light" Mac theme as well as the "Dark" theme.
Comment 17 Lars Vogel CLA 2020-11-19 02:39:36 EST
Adding Jeeeyul, as he is very experience in CSS styling and recently worked on SWT for the Mac. Jeeeyul, maybe you can help?
Comment 18 Phil Beauvoir CLA 2020-11-21 14:01:05 EST
Created attachment 284844 [details]
Screen shot of Light Theme toolbar

(In reply to Phil Beauvoir from comment #16)
> The white line is visible using the "Light" Mac theme as well as the "Dark"
> theme.

It's not always visible - resizing the sash from left to right will trigger it.
Comment 19 Phil Beauvoir CLA 2020-11-21 14:02:38 EST
Created attachment 284845 [details]
Screen shot of System Theme toolbar

Also present in the new "System" theme.
Comment 20 Sravan Kumar Lakkimsetti CLA 2020-11-23 03:28:56 EST
Created attachment 284854 [details]
screenshot of toolbar in ubuntu 20

I am tying to debug this issue, I noticed there is definite problem in the drawing of background for ToolBar(all platforms). If you zoom in attached screenshot you can make out border for the ToolBar. 

In case of Mac the drawing location is not correct. There is a 1 point size difference in ToolBar and its parent ToolBarComposite. I don't have any conclusions yet. 

I noticed the css definition for ToolBar and ToolBarComposite as "inherit". That means the color is getting inherited from a previous layer

I am still investigating
Comment 21 Eclipse Genie CLA 2020-11-24 03:39:13 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/172731
Comment 23 Sravan Kumar Lakkimsetti CLA 2020-11-24 08:17:57 EST
Merged to master
Comment 24 Sravan Kumar Lakkimsetti CLA 2020-11-25 01:53:43 EST
Merged to master and system theme problems are being handled through bug 567631
Comment 25 Lars Vogel CLA 2020-11-25 02:33:55 EST
(In reply to Sravan Kumar Lakkimsetti from comment #24)
> Merged to master and system theme problems are being handled through bug
> 567631

Thanks for fixing this one.
Comment 26 Phil Beauvoir CLA 2020-11-25 05:24:35 EST
Thanks for the fix.

I no longer see the white line on the Light and Dark themes. I still see the white line on the System theme, I guess this is related to bug 567631?
Comment 27 Phil Beauvoir CLA 2020-11-25 05:32:30 EST
Created attachment 284881 [details]
Screen shot of Light Theme toolbar on latest I build

Actually, I am mistaken.

With the latest I-build I am still seeing the white banding on the gradient in the toolbar as before.

If I put the focus on the tree in the package explorer then move the Sash from left to right the toolbar icons are rendered as in the screenshot.
Comment 28 Sravan Kumar Lakkimsetti CLA 2020-11-25 07:04:02 EST
(In reply to Phil Beauvoir from comment #27)
> Created attachment 284881 [details]
> Screen shot of Light Theme toolbar on latest I build
> 
> Actually, I am mistaken.
> 
> With the latest I-build I am still seeing the white banding on the gradient
> in the toolbar as before.
> 
> If I put the focus on the tree in the package explorer then move the Sash
> from left to right the toolbar icons are rendered as in the screenshot.

Raised bug 569168 for the gradient separator line issue.
Comment 29 Lars Vogel CLA 2020-11-26 02:53:57 EST
*** Bug 569179 has been marked as a duplicate of this bug. ***
Comment 30 Lakshmi P Shanmugam CLA 2020-11-26 09:08:59 EST
Verified in I20201125-1800.
With this fix, the white line in the toolbar is no longer seen in the dark theme.

But, it's still seen in the System theme and a gradient is slightly visible in the dark theme too, tracked by bug 569168. 

Light theme didn't have this problem since Bug 566842 was fixed, there is no gradient colours in the toolbar.
Comment 31 Lars Vogel CLA 2020-11-26 09:44:09 EST
(In reply to Lakshmi P Shanmugam from comment #30)
> Verified in I20201125-1800.
> With this fix, the white line in the toolbar is no longer seen in the dark
> theme.
> 
> But, it's still seen in the System theme and a gradient is slightly visible
> in the dark theme too, tracked by bug 569168. 
> 
> Light theme didn't have this problem since Bug 566842 was fixed, there is no
> gradient colours in the toolbar.

Maybe we should remove the gradient from dark theme too?
Comment 32 Lakshmi P Shanmugam CLA 2020-11-26 10:24:41 EST
(In reply to Lars Vogel from comment #31)
> (In reply to Lakshmi P Shanmugam from comment #30)
> > Verified in I20201125-1800.
> > With this fix, the white line in the toolbar is no longer seen in the dark
> > theme.
> > 
> > But, it's still seen in the System theme and a gradient is slightly visible
> > in the dark theme too, tracked by bug 569168. 
> > 
> > Light theme didn't have this problem since Bug 566842 was fixed, there is no
> > gradient colours in the toolbar.
> 
> Maybe we should remove the gradient from dark theme too?

Yes, if we can remove the gradient from dark theme and system theme, we will not see this problem in Eclipse.

I mentioned in #comment15, I tried to modify the line that sets the gradient, but it lead to other issues, so I guess more changes are required.
Comment 33 Lars Vogel CLA 2020-12-01 03:03:24 EST
(In reply to Lakshmi P Shanmugam from comment #32)

> I mentioned in #comment15, I tried to modify the line that sets the
> gradient, but it lead to other issues, so I guess more changes are required.

Lets investigate the gradient removal for 4.19.
Comment 34 Eclipse Genie CLA 2021-02-15 14:55:51 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176296
Comment 36 Eclipse Genie CLA 2021-08-26 08:56:39 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/183783