gui-cs / Terminal.Gui

Cross Platform Terminal UI toolkit for .NET
MIT License
9.6k stars 686 forks source link

Remove need for `TileView` - Use `LineCanvas` to draw borders and auto-join borders #2483

Closed tig closed 1 week ago

tig commented 1 year ago

With the new Frames functionality in v2, it will be possible to have subviews with overlapping BorderFrames auto-join borders using LineCanvas.

This will require the new DrawFrames/OnDrawFrames methods to utilize a LineCanvas managed by the superview.

I've done a POC (in the TileView Experiments scenario) that shows this can work.

tig commented 1 year ago

Woot!

A little proof of concept!

All this really took was

a) Adding changing public LineCanvas LineCanvas = new LineCanvas (); to View b) Modifying View.ReDraw to render LineCanvas and then clear it (with a new LineCanvas.Clear method). c) Modifying Frame to use Parent?.SuperView?.LineCanvas ?? LineCanvas; instead of new LineCanvas d) Modifying Frame to NOT render LineCanvas itself

D16CspQ 1

tig commented 1 year ago

@tznind and @BDisp - I've been spending too much time coding lately and need to take a break so I can attend to other tings.

With #2527 merged a TON of v2 stuff (see the Backlog in https://github.com/orgs/gui-cs/projects/1) can be worked on.

I'll still be checking in to do PR reviews but won't be writing much code for a while.

Cheers!

tznind commented 1 year ago

I've been spending too much time coding lately and need to take a break so I can attend to other tings.

Thanks for all the awesome work recently. Our standardisation changes are huge! Its going to be amazing. But definetly work at a sustainable pace. Codings a long road 🚗 🚛 🏍️

tznind commented 1 year ago

A lot of the code in TileView is about enabling user to move the splitter lines, preventing moving the splitters beyond a max/min size for any pair of tiles and having a nice public API to enable user to dynamically split at runtime.

Basically when combined with TabView you can almost have the full 'dock panel' experience (like visual studio).

I love the free floating frames and docking together and I'm happy to update the implementation of draw/layout in TileView if needed. But I think that the control and its API surface are worth keeping?

Happy to discuss it more.

tig commented 1 year ago

What I'm thinking is all of what you describe can be in the View "drag border to size" logic (which does not exist yet but will soon). Thus any view gets the functionality by simply being aligned next to another view with Pos.Right(-1) or equivalent.