DESCRIPTION

Bug 464781 - [Linux] Theme change to dark does not request native GTK
support

Change-Id: I645e6f0c9330e35b84e2b18c4b287dfdd4c3ea2f
Signed-off-by: Chase Horton xxx@xxx.xxx

COMMENTS

author: Brenden Conley
date: 2015-04-16 14:44:45.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/5410/

-------------------------------------
author: Zaid Mosley
date: 2015-04-16 14:54:29.000000000

Patch Set 2: Code-Review-1

(9 comments)

Thanks Sopot, I like the general idea for setting the OS specific values. I'm not sure if this approach is actually the best one. Why not simply add a "dark" preference to Eclipse and if this preference is set to true a preference listener is triggered and sets this property. We can use existing CSS to set this preference in the dark theme.

See inline for detailed feedback on the code.

Line:11, bundles/org.eclipse.ui.gtk/about.html -> Is this the correct date?

Line:27, bundles/org.eclipse.ui.gtk/src/org/eclipse/ui/gtk/DarkThemeProcessor.java -> Processor seems to not be the correct semantic, I think you want to add a model addon.

Line:5, bundles/org.eclipse.ui.gtk/META-INF/MANIFEST.MF -> Should that be 1.0.0 for the first version? Not sure what our rules are for new fragments, Alexander might know.

Line:3, bundles/org.eclipse.ui.gtk/pom.xml -> SHould that be 2015 and Redhat?

Line:8, bundles/org.eclipse.ui.gtk/pom.xml -> Remove ws

Line:2, bundles/org.eclipse.ui.gtk/README.md -> I think the underlines must match the length of the line

Line:3, bundles/org.eclipse.ui.gtk/README.md -> Please describe the current "tweaks". :-)

Line:2, bundles/org.eclipse.ui.gtk/fragment-gtk.properties -> SHould that be 2015?

Line:9, bundles/org.eclipse.ui.gtk/fragment-gtk.properties -> IBM?

-------------------------------------
author: Zaid Mosley
date: 2015-04-16 14:59:27.000000000

Patch Set 2:

Alternatively to a preference solution you can define a new CSS attribute and register a CSS handler for it which sets this attribute. IMHO that is the best solution for this requirement, adding Brian as we have better ideas.

-------------------------------------
author: Brenden Conley
date: 2015-04-16 15:20:51.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/5410/ : SUCCESS

-------------------------------------
author: Chase Horton
date: 2015-04-16 15:21:32.000000000

Patch Set 2:

(1 comment)

> (9 comments)
 > 
 > Thanks Sopot, I like the general idea for setting the OS specific
 > values. I'm not sure if this approach is actually the best one. Why
 > not simply add a "dark" preference to Eclipse and if this
 > preference is set to true a preference listener is triggered and
 > sets this property. We can use existing CSS to set this preference
 > in the dark theme.
 > 
 > See inline for detailed feedback on the code.

I'll update the dates/copyright messages. It was a lousy copy-paste from my side.

As for the approach to this I don't think I clearly understand what you mean. We need this to run also on startup and on theme change and this is OS-specific. 

Do you have some pointer in the code where we are doing something similar with CSS handlers? I'll also investigate myself in the meantime.

Line:27, bundles/org.eclipse.ui.gtk/src/org/eclipse/ui/gtk/DarkThemeProcessor.java -> This is actually a processor.

-------------------------------------
author: Zaid Mosley
date: 2015-04-16 15:30:56.000000000

Patch Set 2:

Currently not in front of a computer but look at the css bundles. In Css you can define property handler of css attributes. These are defined via extension point. If the property is present in css your class is called. It could check the OSS via isGtk and set the OS property. Css is called during initial theming as well as during theme switching.

-------------------------------------
author: Teagan Marsh
date: 2015-04-16 16:34:31.000000000

Patch Set 2:

(2 comments)

Line:33, bundles/org.eclipse.ui.gtk/src/org/eclipse/ui/gtk/DarkThemeProcessor.java -> You're not using UISynchronize, which you probably should.  But  you could xxx@xxx.xxx instead.

But UISynchronize is to isolate code from explicitly knowing the UI subsystem (e.g., SWT vs Swing vs Vaadin) whereas this code is very explicitly for SWT, it might just be best to get the corresponding Display (available in the event as IThemeEngine.Events.DEVICE) and do an asyncExec().

Line:43, bundles/org.eclipse.ui.gtk/src/org/eclipse/ui/gtk/DarkThemeProcessor.java -> This is a bit icky, but we have similar id-based encoding in E4Application to recognize high-contrast themes too.  I think in 4.6 we should provide an attribute on the theme extension point to explicitly define the modes.

-------------------------------------
