Hi all,
I’ve been working on adding support for RTL (Right-to-Left) layout to Kodi’s UI, specifically for a `FixedList` view where the entire layout is mirrored, and items are displayed from right to left (HORIZONTAL_RTL), not just RTL text alignment which is already supported. I’ve successfully managed to reverse the item order, but I’m encountering several issues that I need help with.
You can see the changes I made as well as pictures here in the link
https://github.com/DevGeniusCode/xbmc-RT…ff=split&w=
### Issue 1: Mouse Focus Misalignment
When selecting an item with the mouse, the selection doesn’t correspond to the item I’m hovering over. Instead, it seems to select the item that would be in that position if it were still in the original (HORIZONTAL) layout. In other words, the mouse is still behaving as if the list were left-to-right, while visually, it’s now right-to-left.
### Issue 2: List Scrolling Behavior with Keyboard/Remote
In the original (HORIZONTAL) mode, when I move right (with the keyboard or remote), the entire list scrolls to the left to keep the focused item visible, and the leftmost item disappears off the screen.
Now that the list is reversed (right to left), the items scroll in the opposite direction (i.e., to the right when moving left), which is expected. However, the problem is that the leftmost item continues to disappear instead of the rightmost item, which should now disappear when scrolling leftwards.
### Issue 3: Focused Item Visibility
In the original (HORIZONTAL) mode, the item in focus is always visible on the screen. But in the new right-to-left layout, the focused item sometimes goes off the screen. It seems like this is related to the second issue, as if the rightmost item (which should be in focus) is positioned beyond the visible boundaries of the list. This feels like a boundary or layout issue where the list block isn’t adjusting correctly to the RTL layout.
Could someone please provide some guidance on how to address these issues? Specifically:
– How can I fix the mouse focus behavior so it aligns correctly with the new RTL item layout?
– How can I adjust the scrolling behavior so that the rightmost item disappears when moving leftwards (instead of the leftmost)?
– What could be causing the focused item to move off the screen in the RTL layout?
Any insights or pointers would be greatly appreciated!
Thanks in advance for your help.