Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Color of the active button / toogle button

Hello Niraj, Leo and Arun,

thanks for the fast answer.

I think I did not use the correct term in my questions. I'm looking for a way to style "selected" buttons, e.g., the ToolItem widget which shows the active perspective or a ToolItem widget in a view bar is toogled. I tried to do hightlight that in the next screenshot.

Inline image 1

I also finally found the bug for that: https://bugs.eclipse.org/bugs/show_bug.cgi?id=463358

I there a trick to make this styling already work, or do we have to wait for Bug 463358?

Best regards, Lars

On Wed, May 6, 2015 at 4:00 PM, Arun K Thondapu <arunkumar.thondapu@xxxxxxxxxx> wrote:

> <Side note>
>    Gtk's CSS theming does support different colors depending on
> state of the control.
>    (Active, selected, unfocused, mouse-over etc...) but this would
> introduce api change and may not be supported on all platforms.
> </Side note>

Leo, if I'm not wrong, this works only with GTK3 and not with GTK2 and that would make it even more complicated to support an API that can be meaningfully implemented only on GTK3 and not any of the other supported platforms. The workaround approach suggested by you seems to be the best bet for now and should work on all platforms!

Thanks,
Arun

Inactive hide details for Leo Ufimtsev ---06-05-2015 18:45:56---Hello,  <Leo's thought>Leo Ufimtsev ---06-05-2015 18:45:56---Hello,  <Leo's thought>

From: Leo Ufimtsev <lufimtse@xxxxxxxxxx>
To: "Eclipse Platform SWT component developers list." <platform-swt-dev@xxxxxxxxxxx>
Cc: Sopot Cela <scela@xxxxxxxxxx>
Date: 06-05-15 18:45
Subject: Re: [platform-swt-dev] Color of the active button / toogle button
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx





Hello,

<Leo's thought>
 In SWT there is api to set the background of the button, but there is no api to define the color of the actively selected/focused button.

 However, you could make use of a focus listener and make the actively selected button dark.

 I wrote a little proof of concept snippet:
 
https://github.com/LeoUfimtsev/LeoSwtTests/blob/master/src/standaloneTests/LTEST_Button_dark_when_active.java

 To test it you can check out the repo and run the individual java file or copy the snippet and erase line 31. (Btw, Looks nicer with SWT_GTK3=1)

 Attached is a little video of the snippet in action.

 So one potential solution is to include a listener somewhere and when the dark theme is activated, make buttons darker.
</Leo's thought>


<Side note>
  Gtk's CSS theming does support different colors depending on state of the control.
  (Active, selected, unfocused, mouse-over etc...) but this would introduce api change and may not be supported on all platforms.
</Side note>

Thank you

----- Original Message -----
> From: "Niraj Modi" <niraj.modi@xxxxxxxxxx>
> To: "Eclipse Platform SWT component developers list." <platform-swt-dev@xxxxxxxxxxx>
> Sent: Wednesday, May 6, 2015 7:31:35 AM
> Subject: Re: [platform-swt-dev] Color of the active button / toogle button
>
> Hi Lars,
> On Windows we cannot change button background due to platform limitation..
> see bugs 23837 and 23837.
> This is how dark-theme button looks on Windows7:
>
>
> Not sure, the bug that you are looking for is:
>
https://bugs.eclipse.org/bugs/show_bug.cgi?id=462009 - [Gtk3] Button
> background Color fix... something related to dark theme :)
>  
> Regards,
> Niraj Modi
>
>
> From:   Lars Vogel <lars.vogel@xxxxxxxxxxx>
> To:     "Eclipse Platform SWT component developers list."
> <platform-swt-dev@xxxxxxxxxxx>
> Date:   05/06/2015 02:50 PM
> Subject:        [platform-swt-dev] Color of the active button / toogle
> button
> Sent by:        platform-swt-dev-bounces@xxxxxxxxxxx
>
>
>
> Hi SWT development friends,
>
> in our dark theme the background color of the active button is light, see
> screenshot. Does SWT already have API to configure this background color?
>
>
>
>
> If not do you have already a bug report for requesting this feature? I
> think I remember that we had a bug report on this, but I can't find it, so
> maybe this has been fixed or my memory tricks me.
>
> Best regards, Lars
>
> --
> Eclipse Platform UI and e4 project co-lead
> vogella GmbH CEO
>
> Haindaalwisch 17a, 22395 Hamburg
> Amtsgericht Hamburg: HRB 127058
> Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
> USt-IdNr.: DE284122352
> Fax (032) 221739404, Email: lars.vogel@xxxxxxxxxxx, Web:
>
http://www.vogella.com_______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
>
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
>
> _______________________________________________
> platform-swt-dev mailing list
> platform-swt-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
>
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


--
Leo Ufimtsev | Intern Software Engineer @ Eclipse Team
[attachment "Active buttons made dark.ogv" deleted by Arun K Thondapu/India/IBM] [attachment "Selection_014.png" deleted by Arun K Thondapu/India/IBM] _______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


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



--
Geschäftsführer

vogella GmbH

Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (032) 221739404, Email: lars.vogel@xxxxxxxxxxx, Web: http://www.vogella.com

GIF image


Back to the top