natinusala / borealis

Hardware accelerated, controller and TV oriented UI library for PC and Nintendo Switch (libnx)
Apache License 2.0
257 stars 81 forks source link

Reimplement notifications + framerate counter #100

Open natinusala opened 3 years ago

natinusala commented 3 years ago

A concept of "layer" must be introduced, to allow adding stuff below and over activites without hardcoding them in Application.

A layer has a "draw" method and is simply resized to fullscreen when the window gets resized (like activities are). A "ViewLayer" layer must be done, which takes a "root" view and handles layout, etc... the same way the activities work. When a ViewLayer is resized, its view is resized and a layout pass must be done.

The current activities stack must be moved to its own layer. When the window is resized it must resize all layers, which will in turn resize all activities, running a layout pass on each one of them.

Notifications and framerate counter should be on their own layer too. They of course have to be reimplemented using the new layout system.

Notifications should be able to be placed on any corner of the screen. As as for the dialogs, notifications should be both easy to use and extensible - users should be able to post simple text notifications as well as custom views if they want fancy / custom stuff.

Depends on #150 to animate notifications, as well as #154 for the actual framerate counter.

To do list:

EmmmaTech commented 2 years ago

More of a meta thing, but I feel like the layer concept should be moved to its own issue for cleanliness.