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

... overlapping ? #51

Open
MichaelMure opened this issue Nov 3, 2019 · 8 comments
Open

... overlapping ? #51

MichaelMure opened this issue Nov 3, 2019 · 8 comments
Labels
enhancement New feature or request

Comments

@MichaelMure
Copy link

I'm migrating from the original gocui to this awesome community maintained version. In the process, I noticed new parameters for NewGui() and SetView(). Looking at the code, it's not super obvious what this overlapping is about and how it could/should be used.

Could you explain a little bit what it is about and maybe give a small example?

Thank you

@MichaelMure MichaelMure added the enhancement New feature or request label Nov 3, 2019
@mjarkk
Copy link
Member

mjarkk commented Nov 23, 2019

Thanks for noting this,
This is indeed something we need to add some documentation about.

This behavior is copied over from @jesseduffield fork and if i'm correct if overlapping is true and 2 frame borders merge these kind of chars will be used and if false the most top frame will just be rendered without merging the frame lines and thus leaving some empty room between lines.

I'm not going to add much documentation for now because for the time i put in this project i'm mostly busy with debugging #45 and once that is dune i for sure need to work a bit on the documentation part of this project because there will changes for the end user.

@curusarn
Copy link

That sounds great. Thanks for all the work you put into the project.

Could you explain what overlaps byte parameter in method SetView(name string, x0 int, y0 int, x1 int, y1 int, overlaps byte) (*gocui.View, error) means?

Thank you

@glvr182
Copy link
Member

glvr182 commented Jan 21, 2020

Overlaps describes which edges are overlapping with another view's edges. If Gui supports overlapping, the method drawFrameCorners will decide what rune to use as the corner, using the helper function corner.

In short, its a byte that will be used with a bitwise-or to decide if the corner overlaps or not.

This code might change after the change to tcell, see #45

@MichaelMure
Copy link
Author

Sorry in advance, I'm going to be a bit harsh.

I might be wrong but I'm under the impression that this particular feature has been added by @jesseduffield for one of his particular need (nothing wrong with that) and not really designed for a general use. The API is not so obvious (why a byte ? is that a flag ? an enum ? what should I use there ? why should I give that when I create a view ?). It's also not clear to me why it's not done by gocui internally.

I don't have a vote on this but if I had I would advocate to remove it entirely from the API and deal with that internally and automatically.

Obviously, feel free to disregard all that.

@abitrolly
Copy link

@MichaelMure overlapping is a common features in 2D interfaces. In HTML it is called margin collapsing.

I am not sure what is this overlapped and that's why I subscribed to this issue. If you already got time to draw some examples of how it works, then we can sync on understanding what this stuff is about. and can discuss how to rename, remove or document that.

The biggest concern for me was that API change breaks compatibility with existing software and it needs URL changes.

@abitrolly
Copy link

Forgot to say that I discovered this issue when creating hello world with gocui and understanding what this parameter was important to me. Since then I switched to https://github.com/rivo/tview which appeared to be more simple to start.

@glvr182
Copy link
Member

glvr182 commented Jan 24, 2020

@MichaelMure Dont be sorry for telling us what you think. You are right. Most of the code that was added in the beginning was taken from jesse's fork, this includes some stuff that were especially usefull for jesse's own projects. I agree that it is not clear how it works, and this might not be the best way to implement the overlapping feature. We might need to reconsider this implementation and possible rollback/change some things.

Also I would like to say that everyone has a vote in all the issues that we have. The reason why we made this org/project was to enable others to help make gocui better.

@jesseduffield
Copy link

I can confirm that the overlapping edges thing was fairly experimental and half-baked. I see no issue with scrapping it and it being re-implemented down the line.

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

No branches or pull requests

6 participants