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

Fix checking if sibling is locked when removing Views #526

Merged
merged 4 commits into from Sep 15, 2021

Conversation

Guldoman
Copy link
Member

We only checked if sibling was locked in the x direction. This fixes the broken layout found in lite-xl/console#4.

We only checked if sibling was locked in the `x` direction.
franko added a commit that referenced this pull request Sep 14, 2021
Provide an fix like:

#526

but use instead the is_primary_node property and the context
property.

We align the logic to the one used in the close_all_views method.

The approach using get_locked_size was the old approach using by
rxi's lite but it should no longer be used to determine if a node
if part of the application UI or part of the document's view.
@franko
Copy link
Member

franko commented Sep 14, 2021

Thank you @Guldoman your PR is correct but there is something you couldn't know. The get_locked_node should no longer be used for the purpose of finding out is a node is part of the UI or where we show the documents.

Please review the PR:

#528

where I use instead is_primary_node and the context property we introduced recently.

If the new PR looks fine to you we will merge it and close this one.

@franko
Copy link
Member

franko commented Sep 14, 2021

I take the opportunity to share a problem I observed with the "console" plugin. It is the insert point where it gets attached in the Nodes hierarchy. Sometimes it appears below the TreeView covering all the application horizontal width and something is beside the TreeView occupying only the documents' horizontal space.

I think we should fix this insertion point.

@Guldoman
Copy link
Member Author

Guldoman commented Sep 14, 2021

I take the opportunity to share a problem I observed with the "console" plugin. It is the insert point where it gets attached in the Nodes hierarchy. Sometimes it appears below the TreeView covering all the application horizontal width and something is beside the TreeView occupying only the documents' horizontal space.

I think we should fix this insertion point.

I think this happens because of the order of Node splitting.
One way we could solve that is by providing predefined Nodes in certain positions like a Bottom Node (where plugins like console could add their own Views to), a RightSidebar Node...

@franko
Copy link
Member

franko commented Sep 14, 2021

I thought we may move the treeview and toolbarview from being plugins to being core elements.

These should remove most ambiguity because they are UI elements we want at some specific place while plugins can be loaded in any order.

If the sibling is not locked in the direction of the split, it should 
fill the space.
@Guldoman
Copy link
Member Author

With the last two commits the check is done only in the correct "direction" (for example, if a Node is locked only in the x axis and the split is vertical, the locked node should fill the space).
Also added a check to avoid losing the primary node.

data/core/rootview.lua Outdated Show resolved Hide resolved
Previously if the split type was "hsplit", but `locked_size_x` was 
falsy, `locked_size_y` was wrongly used.
@franko
Copy link
Member

franko commented Sep 15, 2021

Good, you are right about the locked size thing. I will close my other PR, I think the logic I tried to implement is not the right one as you was pointing out.

@franko franko merged commit 66bfff2 into lite-xl:master Sep 15, 2021
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

2 participants