Open
Conversation
68e24fa to
a0c1275
Compare
a0c1275 to
89ec8ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have completed implementing RTL layout in Iced. But I have extracted a smaller piece of it with a small example in this PR to make reviewing and feedback easier.
Design
A
Directionprimitive is defined and added toSettings. It is then passed down to all children viaLimits.The direction for a widget can be explicitly set, or it can inherit it from its parent. You may want a part of your app to always be drawn in the same direction as you're designing for example if you have two buttons that say ", ".
There is no
AutoinDirection, just LTR and RTL. The app developer can decide based on the translated language, or some other factor what the direction should be (whoever is doing i18n can decide). So, Iced doesn't need to automatically detect and change the direction.Request
The process of updating all widgets to support the direction can be done over time and widget by widget. However, the main thing that I need your input on is the
Directionprimitive and how to pass it down the tree? Is this the best approach for Iced? Is the design sound? I will be working on integrating this into libcosmic, but before I do that I want to get your opinion and make sure the design is solid on you're onboard, or ideally get this merged into Iced first.In this PR I have applied the direction to
rowandtogglerand added a small example that shows how changing the direction inSettingswould change the alignment and the order of the widgets.Note: if you don't set the direction in the settings, everything should render exactly as before. If this feature is done right, people who don't need RTL won't notice anything!
Here's our discussion in zulip.
Here's how you set this in GTK.