Skip to content
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

Open
wants to merge 19 commits into
base: next
Choose a base branch
from

Conversation

jtaala
Copy link
Contributor

@jtaala jtaala commented Jan 17, 2022

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!

wlhlm and others added 14 commits November 24, 2020 13:11
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.
@jtaala jtaala mentioned this pull request Jan 29, 2022
@RayZ0rr
Copy link

RayZ0rr commented Feb 22, 2022

Maybe add split none command as mentioned here #3808 to complete the suit 😄

@jtaala
Copy link
Contributor Author

jtaala commented Feb 22, 2022

Maybe add split none command as mentioned here #3808 to complete the suit smile

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).

@RayZ0rr
Copy link

RayZ0rr commented Feb 27, 2022

Maybe add split none command as mentioned here #3808 to complete the suit smile

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants