Iâm experimenting with separate the widget from the skin⦠problem is sometimes theming is just change colors, but some others is widget building it self, so we will need widget factories (for theme), etc. all is doable, but all implies time :) On 07 Jan 2014, at 11:07, Stéphane Ducasse <Stephane.Ducasse@inria.fr> wrote:
I think this is too convoluted because, like Estaban says, you want to keep the theming orthogonal with widget definition.
Yes I do not like it either.
But, you gave me an idea:
If we implement in Morph the followings:
Morph>>themer ^ themer ifNil: [self themerFor: self theme]
what would be self theme I do not really like the idea to have all the morph talking to UITheme theme ^ UITheme current is not sexy to me
Morph>>themerFor: aTheme ^ self subclassResponsibility
And then in a morph we would have something like this:
SpotlightItemMorph>>themerFor: aTheme ^ aTheme spotterThemer
SpotlightItemMorph>>onSelected self themer configureSelectedItemMorph: self
Then we could simply do pretty much what you want:
SpotlightItemMorph new themer: MySpotterThemer new.
I like this idea. What do you think?
I do not know. Now what is clear is that we need strategy as in your original design. I was thinking about that too.
Stef