I think that perhaps rewriting the code to pack in the same order as in LTR might still have some advantages. I've tried to think on how that would work. Instead of walking the list of HLayout children in reverse, and packing them to the left, I'll walk the list in the usual order, and pack from right to left.
As far as I can see, I would only need to change HLayout::ComputeContentSize, and HLayout::ComputeContentPosition, which would make the changes simpler. I'm sure in both cases other widget will need to be modified, but if any widget's layout depends on the order of children's placement, then that order wouldn't change.
Regarding tests, I suppose that a tests for HLayout can be modified to test the RTL case as well, but I cannot find such a test (perhaps my tree isn't updated). I imagine a test that creates an HLayout, with several children that are using different settings for scaling, vertical placement, etc. and asserting there placement. What do you think?
Hi,
I think that perhaps rewriting the code to pack in the same order as in LTR might still have some advantages. I've tried to think on how that would work. Instead of walking the list of HLayout children in reverse, and packing them to the left, I'll walk the list in the usual order, and pack from right to left.
As far as I can see, I would only need to change HLayout: :ComputeContent Size, and HLayout: :ComputeContent Position, which would make the changes simpler. I'm sure in both cases other widget will need to be modified, but if any widget's layout depends on the order of children's placement, then that order wouldn't change.
Regarding tests, I suppose that a tests for HLayout can be modified to test the RTL case as well, but I cannot find such a test (perhaps my tree isn't updated). I imagine a test that creates an HLayout, with several children that are using different settings for scaling, vertical placement, etc. and asserting there placement. What do you think?