Le 18/10/2013 11:18, Esteban Lorenzano a écrit :
On Oct 18, 2013, at 11:15 AM, Goubier Thierry <thierry.goubier@cea.fr> wrote:
Le 18/10/2013 10:33, Esteban Lorenzano a écrit :
I started to experiment with a dark theme (after Phil asked it).
You've beaten me to it! But I know that I'm having too much on my plate at the moment.
yeah, me too... but I also have insomnia, and those nights I usually hack something (only condition is: no regular work, just things I'm curious or exited) :)
I now have so little time to myself that I can only focus on things I like :) And destroying dry walls is on my leisure schedule, not Pharo coding...
The problem is that everything in morphic is so crapy programmed that remove the hardcoding stuff is incredible hard.
One of the reason why I wasn't rushing to it :):)
Anyway, I have an initial design that could work (at least for the simple skins), now it remains the work of decoupling the skin from the morphs... no idea when I will finish anyway.
Could you reuse the Pharo theme and change the color scheme here? I expected that dark theme issue and related work to be a good test bed to redesign / modularize the theme software architecture, but if people need it, then rushing a bit and refactoring later could be the way to go.
yes, but even the basics is hard to achieve. So far my design is simple: let the morphs skins themselves, using a theme (or the default), and double dispatch to ensure decoupling...
The design works, the problem is the cleanup needed to make it work (tons of places where colors and others are hardcoded). Take this as an example:
Text class>>fromString: aString "Answer an instance of me whose characters are those of the argument, aString."
| defaultFontStyle fontNumber |
defaultFontStyle := TextStyle default. fontNumber := defaultFontStyle ifNil: 1 ifNotNil: [defaultFontStyle defaultFontIndex].
^ self string: aString attributes:{ (TextFontChange fontNumber: fontNumber). ( TextColor color: Color black ) }
The problem is that this is constructing a Text object with hardcoded default attributes (which btw, are non necessary). That means if you have a black (or darkGray) bg for your text areas, as soon as you accept (it creates a "clean text object") you will not be able to see your text :) Other thing is that many of this stuff are not just bad, but also useless, I rewrote that method as:
^ self string: aString attributes: {}
and everything continues working exactly as before (with the difference that now a black bg works :)
Impressive, really! Thierry -- Thierry Goubier CEA list Laboratoire des Fondations des Systèmes Temps Réel Embarqués 91191 Gif sur Yvette Cedex France Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95