Updated docs with modals page

This commit is contained in:
Prozilla 2023-08-11 20:00:44 +02:00
parent de765c5f27
commit c55ed29bff
No known key found for this signature in database
GPG key ID: 5858DFE71CAF31EE
2 changed files with 10 additions and 0 deletions

View file

@ -13,3 +13,4 @@ Most code for features can be found in the [features](../../src/features) direct
- [Windows](windows/README.md)
- [Taskbar](taskbar/README.md)
- [Settings](settings/README.md)
- [Modals](modals/README.md)

View file

@ -0,0 +1,9 @@
[← Back](../README.md)
# Modals
Modals are modular components that can be instantiated by other components. This feature is mainly used for context menus that are instantiated by windows.
Modals prominently take a position and a callback function as input. When the modal is closed, the callback function is called with optional arguments that usually include whatever the user entered as input while the modal was active. E.g.: A confirmation dialog is usually instantiated at the center of the screen and returns "yes" or "no" to the callback function, depending on which button the user clicked.
Even though modals are very similar to windows, they are also very different. You can look at modals as mini sub-windows that each have their own styling, as opposed to windows that all have a header with a title and some buttons.