Efl.Orient (enum) and Efl.Orientation (interface) are used in both UI and image types of elements, with mixed results:
Orientation takes the values 0,90,180,270 and its default value is "UP". This doesn't make sense for UI elements, which are by default oriented either down- or right-wards.
I propose to introduce a new enum Efl.Ui.Dir and the associated interface:
enum Efl.Ui.Dir { [[Direction for UI objects and layouts. Not to be confused with $Efl.Orient which is for images and canvases. This enum is used to define how widgets should expand and orient themselves, not to rotate images. See also @Efl.Ui.Direction. ]] default = 0,[[Default direction. Each widget may have a different default.]] horizontal, [[Horizontal direction, along the X axis. Usually left-to-right, but may be inverted to right-to-left if mirroring is on.]] vertical, [[Vertical direction, along the Y axis. Usually downwards.]] ltr, [[Horizontal, left-to-right direction.]] rtl, [[Horizontal, right-to-left direction.]] down, [[Vertical, top-to-bottom direction.]] up, [[Vertical, bottom-to-top direction.]] right = Efl.Ui.Dir.ltr, [[Right is an alias for LTR.]] left = Efl.Ui.Dir.rtl, [[Left is an alias for RTL.]] }
Vertical/up/down are not a problem I think.
My only worry is basically how to handle RTL. I believe that:
- LTR always means LTR (== right)
- RTL always means RTL (== left)
- HORIZONTAL means LTR in ltr locales and RTL in rtl locales, depending on how the mirroring is set. If mirroring is true then it'll mean rtl. By default it means ltr.
- DEFAULT follows whatever the widget decides, which means HORIZONTAL in many cases (eg. progressbar, slider, ...).
I'm just not 100% sure about mirroring.