migueldeicaza / TermKit

Terminal Kit - Console UI toolkit for Swift applications
MIT License
461 stars 17 forks source link

Toplevel/Application redesign ideas #35

Open migueldeicaza opened 3 years ago

migueldeicaza commented 3 years ago

I think it would be useful to redesign Toplevel, because:

Application:

Currently, Window subclasses Toplevel.

So we could have something like this:

Toplevel:

Question: what is the shared base class for Window and Application? Maybe TopLevel become just the host for the backing store and the modal attribute?

Application (not sure if this is the best name)

TBD:

Modality alternative: maybe making something modal creates a full-screen view that captures all mouse and keyboard events, but does not draw everything (or is transparent).

migueldeicaza commented 3 years ago

Pending tasks:

The redraw method on the Toplevel probably needs to check if the backingStore is still correct? But that might get a clipped region, so it wont be able to paint the real region.

So what is needed is when the size of the Toplevel changes, it needs to have its backing store invalidated, and the view redrawn. And currently this is not the case.

Other things: