Remove uses of renderer cache in textgrid - #5834
Conversation
There was a problem hiding this comment.
Thanks for this. This is great stuff and an important change. I'm not entirely sure how to solve this some other way but I think this still might be breaking the promise of widgets not referencing their renders because some of the widgets that make up the rows etc. are now referencing the objects that the renderer is rendering. See discussion on #5822.
|
|
||
| func (t *textGridRowRenderer) appendTextCell(str rune) { | ||
| th := t.obj.text.text.Theme() | ||
| func (t *textGridRow) appendTextCell(str rune) { |
There was a problem hiding this comment.
The method ordering here is a little strange now that the widgets methods are below the renderer struct.
There was a problem hiding this comment.
Moved textGridContentRenderer and textGridRowRenderer typedefs so that they are above their methods, thanks!
d278882
I could be wrong here, but I think this is a different case. |
|
Hmm. Good point. If you think about those sub widgets being opened by the main renderer it kind of makes sense. However, they are still widgets so I don't know how to reason about it. I think it is best to check with Andy. |
|
I think this change makes sense. Many widgets will be children of the parent widgets, the pattern here doesn't seem to go against the pattern of referencing renderers. |
|
Great :) |
Description:
Remove usage of renderer cache in TextGrid, per #5827
I also fixed a bug where
textGridRowwas only callingExtendBaseWidgetonce its renderer was created. This was causing a couple of tests to fail, because with thecache.Renderercalls removed, we were no longer creating the renderer during unit test setup.Because we are now extending BaseWidget on creation of rows, a lot of snapshots needed updating. I took a look at the changes, and I think they were actually wrong before. LMK if I'm wrong about that :)
Checklist: