Replies: 2 comments 1 reply
-
Just in case that calling the native methods might be a bottleneck, it might be even better to cache some size in the Widget e.g. just as an example if I take a |
Beta Was this translation helpful? Give feedback.
-
Please capture the SashForm problem as an issue, and let's check if it works better with UN-cached sizes.
See caching comes with a trade-off and it should be re-validated when needed, other-wise we may see issues. |
Beta Was this translation helpful? Give feedback.
-
I recently noted that a large part of complexity in layouts is because of caching computed size of children.
Even worse, it sometimes leads to wrong/bad looking layouts (e.g. when wrapping is involved) and one has to install listeners to update or force layouts e.g. there are > 200 calls in platform to
org.eclipse.swt.widgets.Composite.layout()
even though it is "discouraged" to call this method. I most prominent noted that with SashForm that useslayout(false)
leading to components being cut-off instead of wrapped in certain layout combinations, because if a previously (non wrapped) size was cached.That said, I wonder how expensive (today) computing the size of a component actually is and we may be able to just throw away the caching given that often flushing the cache is enforced and if not it causes problems in some situations.
Beta Was this translation helpful? Give feedback.
All reactions