Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [e4-dev] Dynamic CSS Theme Switcher


That's the conclusion I came to as well.  

The underlying problem is the interaction between the CSS declarative styling, and programmatic changes to the widget. In a world where you only expect CSS to style the widgets then the right answer is as discussed, you reset the widget to it's default state (typically by use of null in a given setter).


In a world where you have both declarative and programmatic changes to the widgets ... I'm not sure you can solve the general problem because you always have the possibility of some code being run to change the widget state after it's been styled, either because styling got in too early, or because of some intended dynamic behaviour.  What constitutes it's 'default' state now?  Unclear, plus there's the complication of having to track and record the widget state changes.  You can never be sure that the program has finished with the "default widget configuration" and that you can now apply the styling.  I don't know how to do it in a backwards compatible way.  

So I think we should stop trying to capture the widget state, and instead just reset it to 'factory default'.  

That said, it's still not clear what the best way is for us to interact with legacy code.


Regards,
Kevin

PS. The only mix of declarative and programmatic I can think of is something like:

        widget.configure(WidgetConfigurer config);

where WidgetConfigurer encapsulates the programmatic widget mods. It would be run after widget creation but before declarative styling, and could be run again in the future for implementing dynamic programmatic changes. This of course also assumes that there is notification of widget creation, see bug #260406.  In any case, I think it's the wrong programming model, since if you're rewriting your code anyway, you should encode dynamic behaviour through changes in css class selectors.



"Toedter, Kai" <kai.toedter@xxxxxxxxxxx>
Sent by: e4-dev-bounces@xxxxxxxxxxx

05/29/2009 09:03 AM

Please respond to
E4 Project developer mailing list <e4-dev@xxxxxxxxxxx>

To
"E4 Project developer mailing list" <e4-dev@xxxxxxxxxxx>
cc
Subject
RE: [e4-dev] Dynamic CSS Theme Switcher





Hi Angelo,

> I think we must not compute default styles but return default SWT
values to reset CSS styles.

Yes, I agree.
I would expect that an SWT based css engine resets all SWT widgets to
the SWT defaults. After the reset, the Look & Feel would be the same if
the application would not have used css styling at all. Then, after
applying the new css style these defaults would be overwritten.

Best regards,

Kai
_______________________________________________
e4-dev mailing list
e4-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/e4-dev


Back to the top