New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reverse layouts (completion of PR 4246) #4794
base: next
Are you sure you want to change the base?
Conversation
The layout fill order allows to configure how Cons are attached to a new layout. The value 'default' keeps the traditional order, filling the layout from left to right, or top lo bottom depending on horizontal or vertical orientation. 'reverse' in turn means to fill a layout from right to left, or bottom to top. This commit does not yet add the behaviour described above, but merely extends data structures to accommodate for this new option. We only store a single fill order per Con and not any additional values for the workspace layout and last split layout as those variables are necessary to deal with the default layout which does not apply to the fill order.
The tree representation was updated to support the new reverse layouts in the form of 'Vr[]' (N.B. the 'r' suffix). cmp_tree() needs to be updated to work with those extended strings.
This enables the layout fill order to be saved using i3-save-tree and restored using attach_layout.
This adds support to specify the default layout fill order for workspaces. workspace_layout receives an additional optional argument to set layout fill order to reverse.
Calling 'layout <layout> reverse' allows to change the current layout to a new layout with reverse fill order.
Allows splitting the current con into all directions by creating new horizontal or vertical splits with corresponding layout fill order. This is accomplished by changing tree_split() to accept a direction_t instead of just orientation_t. Also convert 543-layout-reverse.t to use subtests to improve structure and output readability.
With the newly introduced reverse layouts, new windows can appear on the opposite side of where the split indicator used to be drawn. This updates the drawing code to draw the indicator closer to new windows.
This was a relatively complicated assignment repeated twice. Factor it out into its own function.
reverse argument) and manipulating layout.
Maybe add |
That functionality is not related to this PR (unless I'm missing something) - not sure why we would add that functionality to this PR. A PRs scope should be narrow btw (e.g. not add unrelated functionality etc). |
Yes, you are right. It's not right to mix it with this PR |
method parameters for right-to-left layouts.
This PR is to complete PR 4246.
Given @wlhlm does not appear to be available to complete his PR, I've taken it upon myself to help finish @wlhlm's great work in an effort to finally have this feature added to i3!
I have:
Given the hard work and the quality of @wlhlm's work, plus the evident usefulness of the feature - I would liked to request feedback (on the documentation etc.) so we can finally merge this feature into i3:next!