Bug 559660 - [10.15][MacOS] Toolbar button text hard(er) to read
Summary: [10.15][MacOS] Toolbar button text hard(er) to read
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.15   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-29 07:48 EST by Thomas Singer CLA
Modified: 2020-03-23 05:29 EDT (History)
7 users (show)

See Also:


Attachments
Snippet (937 bytes, text/plain)
2020-01-29 07:48 EST, Thomas Singer CLA
no flags Details
Screenshot on macOS 10.15 (23.14 KB, image/png)
2020-01-29 07:49 EST, Thomas Singer CLA
no flags Details
Screenshot on macOS 10.14.6 (21.94 KB, image/png)
2020-01-29 08:01 EST, Thomas Singer CLA
no flags Details
Snippet 2 (1.05 KB, text/plain)
2020-03-23 05:24 EDT, Thomas Singer CLA
no flags Details
Screenshot macOS 10.14 - default (light system theme) (15.87 KB, image/png)
2020-03-23 05:28 EDT, Thomas Singer CLA
no flags Details
Screenshot macOS 10.14 - with re-setting the toolbar foreground color (light system theme) (15.38 KB, image/png)
2020-03-23 05:29 EDT, Thomas Singer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Singer CLA 2020-01-29 07:48:17 EST
Please launch the attached snippet on macOS 10.15 switched to dark theme. As you can see, the text is hard to read. Maybe an alpha-blended color reported by macOS was not correctly converted to a real color?
Comment 1 Thomas Singer CLA 2020-01-29 07:48:56 EST
Created attachment 281641 [details]
Snippet
Comment 2 Thomas Singer CLA 2020-01-29 07:49:48 EST
Created attachment 281642 [details]
Screenshot on macOS 10.15
Comment 3 Thomas Singer CLA 2020-01-29 08:01:34 EST
Created attachment 281643 [details]
Screenshot on macOS 10.14.6
Comment 4 Alexandr Miloslavskiy CLA 2020-02-18 10:21:44 EST
Frankly, my findings surprised me: GC ignores alpha component of 'GC.setBackground()', 'GC.setForeground()' etc, replacing it with GC.getAlpha() instead.

This seems to happen on all 3 platforms, and for example on macOS the code seems to remain unchanged since initial implementation.

See for example 'GC.checkGC' on macOS:
NSColor bg = data.bg = NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f);

In 21st century, I see the behavior of ignoring Color's alpha as... ancient, at best.

I see a simple solution here: multiply gc.getAlpha() by Color.getAlpha(), problem solved. However, this is a breaking change, and could cause issues if for whatever reason some colors had wrong alpha values which were previously ignored. Yes, technically that's a bug in that other code, yet still...

What do you think?
Comment 5 Alexandr Miloslavskiy CLA 2020-02-18 10:25:15 EST
Gosh, sorry, posted things to a wrong bug. I was meaning to post to Bug 558258.
Comment 6 Thomas Singer CLA 2020-03-23 05:22:39 EDT
There seem to be weird things going on inside SWT even on macOS 10.14. When launching the snippet 2 (which differs only from 1st snippet by logging the foreground color and possibly setting it), it makes a difference whether the toolbar's foreground color is set to its own value or not. Without setting it, the toolbar's texts are (dark) gray, with setting it, they are black.
Comment 7 Thomas Singer CLA 2020-03-23 05:24:40 EDT
Created attachment 282187 [details]
Snippet 2
Comment 8 Thomas Singer CLA 2020-03-23 05:28:39 EDT
Created attachment 282188 [details]
Screenshot macOS 10.14 - default (light system theme)
Comment 9 Thomas Singer CLA 2020-03-23 05:29:19 EDT
Created attachment 282189 [details]
Screenshot macOS 10.14 - with re-setting the toolbar foreground color (light system theme)