Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Question regarding theming

Dear Leo,

 

we do enable / disable them. But because of  https://bugs.eclipse.org/bugs/show_bug.cgi?id=4745 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=22782 we in addition change the colors.

 

Regards,

Matthias

 

Matthias Becker

Development, PI Tech Core ABAP Server (SE)

SAP SE, Dietmar-Hopp-Allee 16, 69190 Walldorf, Germany

 

T +49 6227 7-60223, M +49 151 53858523, E ma.becker@xxxxxxx

 

 

Pflichtangaben/Mandatory Disclosure Statement:

http://www.sap.com/company/legal/impressum.epx/

 

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.

 

This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.

 

From: <platform-ui-dev-bounces@xxxxxxxxxxx> on behalf of Leo Ufimtsev <Leonidas@xxxxxxxxxx>
Reply-To: "Eclipse Platform UI component developers list." <platform-ui-dev@xxxxxxxxxxx>
Date: Wednesday, 28. June 2017 at 15:19
To: "Eclipse Platform UI component developers list." <platform-ui-dev@xxxxxxxxxxx>
Subject: Re: [platform-ui-dev] Question regarding theming

 

Not sure, but maybe org.eclipse.jface.preference.JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR is what you're looking for.

That color is styled by dark theme.

But for your use case, why don't you enable/disable the Control instead of changing color?

 

On Wed, Jun 28, 2017 at 3:00 AM, Becker, Matthias <ma.becker@xxxxxxx> wrote:

Dear Leo, Dear Eric,

 

sorry for getting confused with the names.

 

Thanks for making clear the different concepts of the OS, SWT and Platform. That’s really helpful.

 

I refer to changes of the Eclipse Platform changes.

 

Let me explain the use case:

We have some semantic state that we visualize by setting background and foreground colors of some widget. In the light theme this looks like this:

 

If this semantic state changes the background and foreground color needs to be reset to “norma”. This then looks like this:

 

At the moment, we do this resetting by calling setBackground/setForeground(null); . This works fine in the light theme, but in the dark theme this causes the labels to have white background and not the dark one defined in platfrom’s current theme definition.

 

Is there a platform API that offers this?

 

Regards,

Matthias

 

Matthias Becker

Development, PI Tech Core ABAP Server (SE)

SAP SE, Dietmar-Hopp-Allee 16, 69190 Walldorf, Germany

 

T +49 6227 7-60223, M +49 151 53858523, E ma.becker@xxxxxxx

 

 

Pflichtangaben/Mandatory Disclosure Statement:

http://www.sap.com/company/legal/impressum.epx/

 

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.

 

This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.

 

 

From: <platform-ui-dev-bounces@xxxxxxxxxxx> on behalf of Leo Ufimtsev <Leonidas@xxxxxxxxxx>
Reply-To: "Eclipse Platform UI component developers list." <platform-ui-dev@xxxxxxxxxxx>
Date: Monday, 26. June 2017 at 18:10
To: "Eclipse Platform UI component developers list." <platform-ui-dev@xxxxxxxxxxx>
Subject: Re: [platform-ui-dev] Question regarding theming

 

Hello Matthias,

(Note,  Me[Leo] /Eric are different developers).

Let me explain how the theaming works, then I'll try to answer your question within that context.

One thing to understand is that "Dark Theme" is not an SWT concept, but a platform-ui concept.

SWT doesn't have a notion of light or dark theme. Instead it just returns whatever color it is given by the operating system at initialization. These will be the colors defined by OS theme.

Now the Platform.UI theming is dependent on user preference. The user may want to select a "Eclipse light theme" or an "Eclipse dark theme". If a "Eclipse dark theme" is selected, then Platform.UI manually passes colors to SWT and overrides OS defaults.

(But in addition, it asks SWT to use "dark" variants of the OS theme. But let's ignore this for now).

So via SWT alone, there isn't a way to deal with Eclipse theming changes, because SWT doesn't know about Eclipse theming. If you want your U.I to respect Eclipse theming, then you need to use Platform.UI defined colors and listen to changes to that color in user preferences. Now, if you're asking about changes in OS theming, then that's a different matter. (let me know if that's what you're after).

If it helps, here is a diagram:
line image 1

Does that answer your question?

If not, can you clarify:

- Do you refer to theme changes in OS or Eclipse?

- Can you clarify an example use case where you need to react to theme changes?

Thank you.

Leo Ufimtsev

 

 

 

 

 

On Wed, Jun 21, 2017 at 11:24 AM, Becker, Matthias <ma.becker@xxxxxxx> wrote:

Dear all,

 

if I see it correct colors you obtain via Display.getCurrent().getSystemColor( ) (e.g. SWT.COLOR_WIDGET_BACKGROUND) are not adapted via the CSS theming.

 

So all usages of Display.getCurrent().getSystemColor( ) are potential causes for theming errors. Is there a clear guidance on the usage of Display.getCurrent().getSystemColor( ) and possible alternatives?

 

Is there an API to obtain e.g. the background color an SWT text widget would get based on the current theme? I know I can call Control.getBackground() to get the current background color of a given

control but what to do if don’t have an instance of SWT.Text at hand?

 

Regards,

Matthias


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev




--

Leo Ufimtsev

Software Engineer

Red Hat

 

90 Eglinton Ave E #502,

Toronto, ON M4P 2Y3

Leonidas@xxxxxxxxxx  

CHAT:

  - IRC: http://webchat.freenode.net/?channels=#swt

  - MatterMost: https://mattermost.eclipse.org/eclipse/channels/platform-swt

 


_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev




--

Leo Ufimtsev

Software Engineer

Red Hat

 

90 Eglinton Ave E #502,

Toronto, ON M4P 2Y3

Leonidas@xxxxxxxxxx  

CHAT:

  - IRC: http://webchat.freenode.net/?channels=#swt

  - MatterMost: https://mattermost.eclipse.org/eclipse/channels/platform-swt

 


Back to the top