[Cuis-dev] LayoutMorph>>adoptWidgetColor:
Juan Vuletich
juan at cuis.st
Mon Jun 22 11:30:49 PDT 2026
Hi Luciano,
On 2026-06-22 5:10 AM, Luciano Notarfrancesco via Cuis-dev wrote:
> I still find the adoptWidgetColor mechanism confusing. It often makes
> colors change in unexpected ways.
Yes. It is crap.
>
> Here’s an example. I’d like to explicitly set a color for a layout
> morph with color:, but how can I do that without the color being later
> replaced here?
>
> LayoutMorph>>adoptWidgetsColor: paneColor
> super adoptWidgetsColor: paneColor.
> adoptsWidgetsColor
> ifTrue: [ self color: (Theme current buttonColorFrom: color) ]
> ifFalse: [ self color: `Color transparent` ]
>
> I’d like to make this simpler, not more complicated by adding yet
> another case. Eg, I wouldn’t want to change the doAdoptWidgetColor
> ivar into a colorAdoptionPolicy to cover my use case, I’d rather
> remove it completly and simplify it if that was possible.
Agreed!
> I’m the only one who thinks we should change this behaviour? How
> should we change it? Or perhaps there’s already a way to get the
> behaviour I want without changing anything?
>
> Thanks,
> Luciano
>
No, we should find a better way.
A long time ago we added UI Themes to Cuis. For this to be flexible and
nice, we want to support 'external' definition of base color for each
kind of tool, and the various derived colors for each widget. At that
time, I came up with #adoptWidgetColor: It was not a good solution. We
should find a better one.
Thanks,
--
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260622/a3c1852e/attachment.htm>
More information about the Cuis-dev
mailing list