[Pharo-dev] The Pharo 3 theme

Esteban Lorenzano estebanlm at gmail.com
Fri Oct 18 05:18:36 EDT 2013


On Oct 18, 2013, at 11:15 AM, Goubier Thierry <thierry.goubier at 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) :)

> 
>> 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 :)

Esteban


> 
> Thierry
> 
>> 
>> Esteban
>> 
>> 
>> On Oct 18, 2013, at 10:26 AM, dimitris chloupis <thekilon at yahoo.co.uk
>> <mailto:thekilon at yahoo.co.uk>> wrote:
>> 
>>> I completely agree, I hate it as much I hate apples new scroll bar,
>>> that disappear as soon as you stop scrolling with magic mouse making
>>> them impossible to use manually. Also what with all the white ? I
>>> seriously need to make a dark theme for pharo, my eyes start hurting
>>> ..... aaaaaaaaaaaa ;D
>>> 
>>> 
>>> On Friday, 18 October 2013, 11:02, Esteban Lorenzano
>>> <estebanlm at gmail.com <mailto:estebanlm at gmail.com>> wrote:
>>> yesterday I also adding settings for IconSet... so you should be able
>>> to play around with themes and icons :)
>>> 
>>> On Oct 18, 2013, at 10:06 AM, Goubier Thierry <thierry.goubier at cea.fr
>>> <mailto:thierry.goubier at cea.fr>> wrote:
>>> 
>>> > Is unusable on some brightness settings: the scroll bars become
>>> invisible to my old eyes :)
>>> >
>>> > 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
>>> >
>>> 
>>> 
>>> 
>> 
> 
> -- 
> 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
> 





More information about the Pharo-dev mailing list