Topics

Note Selector

Code Reform

Wednesday, August 7, 2024

Considerations:

  • When a style overrides a definition, should it be overriding the entire definition or just certain attributes?
    • Remember, a definition is a collection of attributes that pertain to a themeable widget along with sub-definitions pertaining to the widget's hierarchy.
    • Perhaps a style should contain the same hierarchy as the definition its associated with, but only contain the attributes being overridden.
    • Also, keep in mind that theme items were supposed to be the old theme's equivalent to themeables. With the old system, a themeable would apply the attributes of a theme item (via LAttribute::set_theme_attribute()), and those attributes might be linked to other attributes. This gets more complicated when setting up styles.
  • How are definitions and styles going to be structured as classes?
    • Definitions could be created mostly by converting the existing LThemeItem class.

LThemeItem -> LDefinition

The LThemeItem is being converted to support definitions.

The Layers controller should be responsible for linking definition attributes to theme attributes, as well as overriding definition attributes with style attributes.

LThemeable -> LDefinable

A definition is set to a definable, which is a widget whose appearance can be defined by Layers. This setting of the definition is done by storing a pointer to the definition, which should be maintained by the controller. Typically, only top-level definable widgets need to have their definitions set since the child definitions get applied automatically.

Other

Could widgets apply definitions without relying on it trickling down from a top-level widget?