| Summary: | [MAC][API]Query the current system setting for dark mode | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Lakshmi P Shanmugam <lshanmug> |
| Component: | SWT | Assignee: | Lakshmi P Shanmugam <lshanmug> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ericwill, lshanmug, niraj.modi |
| Version: | 4.12 | ||
| Target Milestone: | 4.13 M3 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| See Also: |
https://git.eclipse.org/r/146543 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ef55fab390e3fdd8fba59a3541336ac5c7f8ac1f https://git.eclipse.org/r/147532 https://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=6659a2b2ce1804d8eee97139cc1771290ebaf1c9 |
||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 547038 | ||
|
Description
Lakshmi P Shanmugam
New Gerrit change created: https://git.eclipse.org/r/146543 @Niraj, can you please provide the Windows implementation for the API? For Windows, we could read the registry entry as specified in https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light-dark-mode-in-win32-application @Eric, Can you please check if you can implement this API on GTK? If this API works on GTK, we could have Eclipse on GTK too start in dark theme when system theme is dark (Bug 547038) I did a quick google search on how to detect the Dark theme, but didn't find anything useful other than this - https://lzone.de/blog/Detecting%20a%20Dark%20Theme%20in%20GTK The API is currently made static and that works fine for Mac & Windows. Will having it as static work for GTK too? (In reply to Lakshmi Shanmugam from comment #2) > @Niraj, can you please provide the Windows implementation for the API? > > For Windows, we could read the registry entry as specified in > https://stackoverflow.com/questions/51334674/how-to-detect-windows-10-light- > dark-mode-in-win32-application Created bug 549713 (In reply to Lakshmi Shanmugam from comment #3) > @Eric, > Can you please check if you can implement this API on GTK? If this API works > on GTK, we could have Eclipse on GTK too start in dark theme when system > theme is dark (Bug 547038) > > I did a quick google search on how to detect the Dark theme, but didn't find > anything useful other than this - > https://lzone.de/blog/Detecting%20a%20Dark%20Theme%20in%20GTK > > The API is currently made static and that works fine for Mac & Windows. Will > having it as static work for GTK too? I'll take a look, should be doable by M3. (In reply to Eric Williams from comment #5) > (In reply to Lakshmi Shanmugam from comment #3) > > @Eric, > > Can you please check if you can implement this API on GTK? If this API works > > on GTK, we could have Eclipse on GTK too start in dark theme when system > > theme is dark (Bug 547038) > > > > I did a quick google search on how to detect the Dark theme, but didn't find > > anything useful other than this - > > https://lzone.de/blog/Detecting%20a%20Dark%20Theme%20in%20GTK > > > > The API is currently made static and that works fine for Mac & Windows. Will > > having it as static work for GTK too? > > I'll take a look, should be doable by M3. Turns out we already have an internal flag in GTK to look for ":dark" variant themes, so this is pretty straightforward. I've uploaded a patch for bug 549733, you can go ahead and merge this one and I'll rebase after you've done so. (In reply to Eric Williams from comment #6) > (In reply to Eric Williams from comment #5) > > (In reply to Lakshmi Shanmugam from comment #3) > > > @Eric, > > > Can you please check if you can implement this API on GTK? If this API works > > > on GTK, we could have Eclipse on GTK too start in dark theme when system > > > theme is dark (Bug 547038) > > > > > > I did a quick google search on how to detect the Dark theme, but didn't find > > > anything useful other than this - > > > https://lzone.de/blog/Detecting%20a%20Dark%20Theme%20in%20GTK > > > > > > The API is currently made static and that works fine for Mac & Windows. Will > > > having it as static work for GTK too? > > > > I'll take a look, should be doable by M3. > > Turns out we already have an internal flag in GTK to look for ":dark" > variant themes, so this is pretty straightforward. I've uploaded a patch for > bug 549733, you can go ahead and merge this one and I'll rebase after you've > done so. Thanks, that's great! To clarify: The API will return true only if :dark is specified in the dark theme name, and will return false for dark themes that don't follow this naming convention, right? Should we mention this as a note in the javadoc? Gerrit change https://git.eclipse.org/r/146543 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ef55fab390e3fdd8fba59a3541336ac5c7f8ac1f (In reply to Lakshmi Shanmugam from comment #7) > Thanks, that's great! > To clarify: > The API will return true only if :dark is specified in the dark theme name, > and will return false for dark themes that don't follow this naming > convention, right? Should we mention this as a note in the javadoc? Correct. This will work for the official GTK theme (which is the only thing SWT-GTK supports), and most "sane" 3rd party themes -- I don't think a Javadoc comment is needed. Resolving. New Gerrit change created: https://git.eclipse.org/r/147532 Gerrit change https://git.eclipse.org/r/147532 was merged to [master]. Commit: http://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=6659a2b2ce1804d8eee97139cc1771290ebaf1c9 Verified in I20190819-2355. |