You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's take, for example, the background color of a Label. Each Control has a setter and getter for the background color property, but it behaves inconsistent. If one sets a null value, the getter will not return null, but the default color. However, setting a color means to use that, while setting null means to "use the default". In other words, this official API is unsufficient for a Renderer to know whether to fill a background or not.
I think, the current situation in Button or Label, where some properties are stored in the control and others in the renderer, is not ideal. I'd prefer to have all properties in one class.
We can solve that by having an internal state object, e.g. CustomLabel (a subclass of CustomControl) where getBackground will return null if null has been set. The Renderer then will access all properties from CustomLabel, not the Label directly.
What do you think?
The text was updated successfully, but these errors were encountered:
Let's take, for example, the background color of a
Label
. EachControl
has a setter and getter for the background color property, but it behaves inconsistent. If one sets anull
value, the getter will not returnnull
, but the default color. However, setting a color means to use that, while settingnull
means to "use the default". In other words, this official API is unsufficient for a Renderer to know whether to fill a background or not.I think, the current situation in Button or Label, where some properties are stored in the control and others in the renderer, is not ideal. I'd prefer to have all properties in one class.
We can solve that by having an internal state object, e.g.
CustomLabel
(a subclass ofCustomControl
) wheregetBackground
will return null if null has been set. The Renderer then will access all properties fromCustomLabel
, not theLabel
directly.What do you think?
The text was updated successfully, but these errors were encountered: