Bug 564022 - org.eclipse.e4.ui.css.swt.theme extension point should declare optional light/dark theme parameter
Summary: org.eclipse.e4.ui.css.swt.theme extension point should declare optional light...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.15   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-06 13:17 EDT by Andrew Obuchowicz CLA
Modified: 2022-02-07 03:49 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Obuchowicz CLA 2020-06-06 13:17:24 EDT
Just today I found out that a theme's ID must contain the string "dark" in order to force SWT widgets to be in dark mode. My theme's ID contained the string "Dark", which was giving me issues when using it on Windows or GTK without a dark GTK theme.

I think it'd be an improvement to provide an optional "isDark" parameter to the org.eclipse.e4.ui.css.swt.theme extension point, which would take a boolean value, and be set to false by default.

Currently, it's somewhat undocumented that a dark theme must include the string "dark" in it's ID. Adding this optional parameter would make it a lot easier for new theme creators to create dark themes :)
Comment 1 Lars Vogel CLA 2020-06-06 15:57:33 EDT
+1
Comment 2 Pierre-Yves Bigourdan CLA 2020-07-12 12:54:35 EDT
I agree that adding an "isDark" parameter to "org.eclipse.e4.ui.css.swt.theme" would be an improvement.

However, there are two places where it could be added in that extension point:
* to the <theme> elements. This seems to be what you are describing, Andrew. It's a nice to have, but once a theme creator figures out that they have to include "dark" in the theme id, it won't change much for them.
* to the <stylesheet> elements. This would be a real game changer in my opinion. Many Eclipse plugins contribute stylesheets to the default Eclipse Dark theme (for example https://github.com/eclipse/eclemma/blob/c648863fb19dd84a5896370573e2cf2e20969d45/org.eclipse.eclemma.ui/plugin.xml#L1065). When someone creates a new dark theme, these don't apply and they have to basically reimplement stylesheets for every single Eclipse plugin out there. For example, in Spectrum theme, Andrew has a number of commits that basically copy the stylesheet of the third-party plugin back into his own theme (for example https://github.com/AObuchow/Eclipse-Spectrum-Theme/commit/a024565d93408a04a62b409b89f30e9ff078c56e). This is a lot of work and makes creating a new dark theme very hard. If third-party plugins could contribute stylesheets for all dark themes rather than just "org.eclipse.e4.ui.css.theme.e4_dark", it would really make theming a lot easier.
Comment 3 Andrew Obuchowicz CLA 2020-07-13 20:20:03 EDT
> * to the <stylesheet> elements. This would be a real game changer in my
> opinion. Many Eclipse plugins contribute stylesheets to the default Eclipse
> Dark theme (for example
> https://github.com/eclipse/eclemma/blob/
> c648863fb19dd84a5896370573e2cf2e20969d45/org.eclipse.eclemma.ui/plugin.
> xml#L1065). When someone creates a new dark theme, these don't apply and
> they have to basically reimplement stylesheets for every single Eclipse
> plugin out there. For example, in Spectrum theme, Andrew has a number of
> commits that basically copy the stylesheet of the third-party plugin back
> into his own theme (for example
> https://github.com/AObuchow/Eclipse-Spectrum-Theme/commit/
> a024565d93408a04a62b409b89f30e9ff078c56e). This is a lot of work and makes
> creating a new dark theme very hard. If third-party plugins could contribute
> stylesheets for all dark themes rather than just
> "org.eclipse.e4.ui.css.theme.e4_dark", it would really make theming a lot
> easier.

+1, I'm 100% for this idea, it'd give a bigger value gain to all theme creators who wish to make a dark theme. Great idea IMO!