Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Separate Styling for different Windows
Separate Styling for different Windows [message #1066976] Fri, 05 July 2013 06:16 Go to next message
Jonas Helming is currently offline Jonas Helming
Messages: 366
Registered: July 2009
Senior Member
Hi,

for an application I would like to apply separate styles to different
windows of the Application. That means, e.g. window A has Theme 1
applied and in parallel Window B Theme 2. This use case is currently not
supported by the API's of the theme engine and the styling engine.
Before I look more detailled into enabnling this: Are there any previous
thoughts on this? Would you be willing to accept such as contribution?

regards
Jonas
Re: Separate Styling for different Windows [message #1067003 is a reply to message #1066976] Fri, 05 July 2013 07:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5020
Registered: July 2009
Senior Member
Themes are a per application and the underlying CSSEngine works on the
display (see ThemeEngineManager). So without reworking the complete
CSS-Engine you can't do that.

The only solution is the cascading nature of CSS. You tag windows with
"windowA"/"windowB" and then you have selectors

..windowA > * > .MPart {
background-color: red:
}


..windowB > * > .MPart {
background-color: green:
}

Tom
On 05.07.13 12:16, Jonas Helming wrote:
> Hi,
>
> for an application I would like to apply separate styles to different
> windows of the Application. That means, e.g. window A has Theme 1
> applied and in parallel Window B Theme 2. This use case is currently not
> supported by the API's of the theme engine and the styling engine.
> Before I look more detailled into enabnling this: Are there any previous
> thoughts on this? Would you be willing to accept such as contribution?
>
> regards
> Jonas
Re: Separate Styling for different Windows [message #1067240 is a reply to message #1067003] Sun, 07 July 2013 17:27 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas Helming
Messages: 366
Registered: July 2009
Senior Member
Hi Tom,
thanks for th suggestion. The problem is that I want to really switch
des thme of windows, not only style the differently, so the selector
work around does not really work. I am aware that the current
implementation does not support this use case. However, I think it
should be possible to rework the CSSEngine to manage the Theme one level
below th display, don't you? AFAIK, the CSSSWTEngine iterates thru all
Shells anyways to apply a new theme, so it could only apply a theme for
a selected one. Do you see any big technical issues with that approach?
Can you imagine to accept a reworked version of the Engine?
You are a good person to have an opinion on that, as you have
implementes the JavaFX version, don't you?

Regards
Jonas

Am 05.07.2013 13:58, schrieb Tom Schindl:
> Themes are a per application and the underlying CSSEngine works on the
> display (see ThemeEngineManager). So without reworking the complete
> CSS-Engine you can't do that.
>
> The only solution is the cascading nature of CSS. You tag windows with
> "windowA"/"windowB" and then you have selectors
>
> ..windowA > * > .MPart {
> background-color: red:
> }
>
>
> ..windowB > * > .MPart {
> background-color: green:
> }
>
> Tom
> On 05.07.13 12:16, Jonas Helming wrote:
>> Hi,
>>
>> for an application I would like to apply separate styles to different
>> windows of the Application. That means, e.g. window A has Theme 1
>> applied and in parallel Window B Theme 2. This use case is currently not
>> supported by the API's of the theme engine and the styling engine.
>> Before I look more detailled into enabnling this: Are there any previous
>> thoughts on this? Would you be willing to accept such as contribution?
>>
>> regards
>> Jonas
>
Re: Separate Styling for different Windows [message #1067255 is a reply to message #1067240] Mon, 08 July 2013 02:47 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5020
Registered: July 2009
Senior Member
On 07.07.13 23:27, Jonas Helming wrote:
> Hi Tom,
> thanks for th suggestion. The problem is that I want to really switch
> des thme of windows, not only style the differently, so the selector
> work around does not really work. I am aware that the current
> implementation does not support this use case. However, I think it
> should be possible to rework the CSSEngine to manage the Theme one level
> below th display, don't you? AFAIK, the CSSSWTEngine iterates thru all
> Shells anyways to apply a new theme, so it could only apply a theme for
> a selected one. Do you see any big technical issues with that approach?
> Can you imagine to accept a reworked version of the Engine?
> You are a good person to have an opinion on that, as you have
> implementes the JavaFX version, don't you?

in FX the root of a Stylesheet system is the Scene (and Stage has a
Scene) so there you have what you request. Currently the Theme
implementation provided by e(fx)clipse does not allow what you request
either although the underlying structure (fx-css-engine) would make it
possible.

Tom
Re: Separate Styling for different Windows [message #1076350 is a reply to message #1067255] Wed, 31 July 2013 04:20 Go to previous message
johannes schmieder is currently offline johannes schmieder
Messages: 1
Registered: July 2009
Junior Member
To complete this topic, if you have selectors based on windows the child elements does not inherit the style because the child-shells-as-children relationship in the model was removed (https://bugs.eclipse.org/bugs/show_bug.cgi?id=375069).

Johannes
Previous Topic:Unregister from EventBroker
Next Topic:Toolbar seperator missing
Goto Forum:
  


Current Time: Thu Apr 24 06:35:57 EDT 2014

Powered by FUDForum. Page generated in 0.03988 seconds