-
-
Notifications
You must be signed in to change notification settings - Fork 3
👷♂️Development
the Application object keeps at all time a Preferences window, and quits if there is no open note. It starts a NoteManager, which manages all the logistics of the app
The window is dead boring - Toggles bound to settings. It only deals with application-wide stuff, and has the appearance of a dialog Only one can exist at any time.
NoteManager keeps track of NoteWindows, and manage new/deletions via a list. It has a Storage. upon startup, it reads the Storage, which gives it a list of NoteData, to create into Notes. when requested to save them, it loops through the list, requests of each a NoteData version, then give the list to Storage
Storage manages the Json and writing to/loading from disk
NoteData represents the raw data for each sticky note. Namely the following properties:
- title (string)
- theme (string - Deprecated)
- color (enum)
- content (string)
- monospace (boolean)
- zoom (uint8)
- width (for non-eOS systems, as Gala manages window size)
- height (for non-eOS systems, as Gala manages window size)
It is an object and incorporate methods to create from Json, or convert to Json You can also create a randomized one, which the NoteManager does when there is no note in storage (and then set it to blue)
I vaguely consider making this a struct, and the methods static functions, to possibly improve load/save ram consumption.
NoteWindow takes a NoteData, read it and create its representation as a Window. It can grab and package all informations back into a NoteData
Each NoteWindow has a Popover, which displays the settings of the specific window It is connected and bound to the window itself.