[Cuis-dev] Text attributes are not respected when rendered in a PluggableListMorph

Juan Vuletich juan at jvuletich.org
Wed May 20 12:42:54 PDT 2020


Not exactly "by design" but "by laziness". As Phil said, recently we 
added color. Before we didn't even have that. Still, lists elements are 
of uniform height. Supporting all the Text attributes would requiring 
varying height elements. Implementing that is more work than just 
color... Take a look at #draw:atRow:on:, and its history.

Cheers,

On 5/13/2020 5:07 PM, Nicolás Papagna Maldonado via Cuis-dev wrote:
> Thanks Phil!
>
> I will play around with it for a bit and see what can I do.
>
> Cheers,
> Nico PM
>
> On Wed, May 13, 2020 at 5:01 PM Phil B <pbpublist at gmail.com 
> <mailto:pbpublist at gmail.com>> wrote:
>
>     Nicolas,
>
>     It was by design.  Juan did that as a bit of a quick hack to
>     provide color support for package/changeset diffs.  That's not to
>     say that it couldn't be expanded to process all the attributes,
>     just that the original implementation was to support the very
>     simple use case of single color entries.
>
>     Thanks,
>     Phil
>
>     On Wed, May 13, 2020, 3:46 PM Nicolás Papagna Maldonado via
>     Cuis-dev <cuis-dev at lists.cuis.st <mailto:cuis-dev at lists.cuis.st>>
>     wrote:
>
>         Hi all!
>
>         As part of Cuis Finder, I was trying to render a collection of
>         formatted Text instances in a PluggableListMorph.
>
>         I've noticed that the format applied to rendered items is
>         based on the first character of the text, not preserving the
>         original formatting.
>
>         Notice that, when evaluating the following snippet, both text
>         instances are rendered fine in the inspector, but not when
>         they are items in a list:
>         https://gist.github.com/npapagna/c1f1acf59ccc56b6fce1eda179aed5fc.
>
>         I was wondering if this by design.
>
>         Is there a way to render Text instances in a list, and have
>         them rendered respecting their formatting?
>
>         Thanks in advance!
>         Nico PM
>         -- 
>         Cuis-dev mailing list
>         Cuis-dev at lists.cuis.st <mailto:Cuis-dev at lists.cuis.st>
>         https://lists.cuis.st/mailman/listinfo/cuis-dev
>
>
>
> -- 
>
> Nicolás Papagna


-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20200520/69d90d2b/attachment.htm>


More information about the Cuis-dev mailing list