Layout APIs should be leading/trailing instead of left/right #1360
porglezomp
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For better UI localizability, alignment, padding, etc. APIs should use "leading" and "trailing" instead of "left" and "right". This way, you can design widgets which work automatically with both left-to-right and right-to-left text directions.
.leading
and.trailing
options.str::trim_left
method was deprecated and replaced withstr::trim_start
.This would still leave the larger task of making widgets handle different text direction locales, but it would be nice if the names in the API didn't get in the way of approaching this.
Places where this seems definitely appropriate to replace with leading/trailing, just looking very briefly:
iced::alignment::Horizontal
iced::Padding
I'm not sure about
iced::widget::tooltip::Position
, but I think it's appropriate to use leading/trailing here.I think
iced::widget::pane_grid::Direction
is probably appropriate remaining left/right, since as I understand it it's used for navigating the visual representation of the layout.Beta Was this translation helpful? Give feedback.
All reactions