[Pharo-project] About UITheme, Widgets and coupling
Hi guys we got rid of preferences as a ugly facade and now we have UITheme and UIManager. I would like to understand how we can skin widgets while be as loosely coupled as possible. May be a UI builder is missingâ¦. I was looking at SystemProgressMorph we setDefaultParameters self theme setSystemProgressMorphDefaultParameters: self updateColor "update the apareance of aMorph" self theme preferGradientFill ifFalse: [^ self]. self fillStyle: (self theme progressFillStyleFor: self) and SystemProgressBarMorph has initialize "Initialize the receiver from the current theme." super initialize. barSize := 0. self fillStyle: ( self theme progressBarFillStyleFor: self); borderStyle: (self theme progressBarBorderStyleFor: self); barFillStyle: ( self theme progressBarProgressFillStyleFor: self) extent: aPoint "Update the bar fillStyle if appropriate." super extent: aPoint. self fillStyle isOrientedFill ifTrue: [ self fillStyle: (self theme progressBarFillStyleFor: self)]. self barFillStyle isOrientedFill ifTrue: [ self barFillStyle: ( self theme progressBarProgressFillStyleFor: self)] So to help me understanding the problem, I thought about the flow of things. I would really to avoid to have - widgets construction code in UITheme and UImanager (ref to debugger UI as mentioned by henryk) - UITheme invocation inside the widgets. May be a widget should have its own state and when we build it the class creation only push the info from the UITheme to the widgets What do you think? Stef
participants (1)
-
Stéphane Ducasse