Topics

Note Selector

Theme Data Restructure

Thursday, July 20, 2023

The LTheme class, as well as the JSON data it loads/saves, should be restructured to better represent a hierarchy of items.

LThemeItem class

A new class called LThemeItem should be created to represent widgets from the application's widget hierarchy. A theme item would contain theme-attributes pertaining to its associated widget as well as a list of pointers to child theme-items. The theme-item hierarchy branching would match the application's widget hierarchy.

JSON Structure

The current structure stores all JSON objects representing widgets in the document object. The hierarchy is represented by using absolute path names as object keys. The following is an example of how this looks:

Screenshot of Old Theme Data Structure

A better way to represent the hierarchy would be to store the child objects within their parents. The following is an example of this improvement:

Screenshot of New Theme Data Structure

Each object associated with a theme-item can contain attributes and children.