-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is ToUninstallSkinEvent usefull ? #217
Comments
A theme must have ways to clean-up the place before it is replaced by another theme. I understand it can be more difficult with style sheet.
I don't think it makes a theme more difficult to create/maintain. |
For example, i have a Button.
In the example, we need to know the previous color of the background of the button when we change skin. |
There is another problem with the myButton := ToButton new.
"Step 1: set the backgroun to yellow."
myButton background: Color yellow.
"Step 2: add a new theme. The background is white."
myButton space toTheme: ToBeeThemeGenerated.
"setp 3: uninstall the theme".
myButton space toTheme: nil.
In the previous code. At the end of Step3, what should be the color of
|
There are elements for styling and others that are technical. |
But it seems to me that there is no issue with all BlElement properties (as #background) because an install can set them to fit the look that the skin want to implement. Normally you can change these properties without having to take care of the previous one. So no need for an uninstall step in these cases. |
A theme no. A skin yes. the same widget can have different configuration according to its skin. This can imply the adding of elements by the skin. ToMenuSkin do that as an example (even it is not a so good example). Another example is the ToAlbumSkin which adds a gray background layer on top in case of a DisabledSkinEvent. Other examples could be the DatePicker and the ColorPicker. They can be dressed differently, with or without additional elements according to the skin. But this is still to be experimented :) |
What is ToUninstallSkinEvent?
ToUninstallSkinEvent is created when a theme is changed.
During this event, the element we want to untheme must have its properties reset to its previous state in order to avoid mixing theme together.
But the previous state should always be the values of the rawskin.
Therefor, why do the Theme need to be uninstalled if we will just reapply the rawskin values ? (We could simply install the rawskin).
Also currently, the theme needs to remember the previous state of the different properties.
The theme must have variable containing the previous theme.
The theme is not stateless.
I think the theme would be easier to create/maintain/understand whithout the ToUninstallSkinEvent.
The text was updated successfully, but these errors were encountered: