Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ButtonStrip UC: implement bulk of new theming features
The trusty horizontal "ButtonStrip" control has been the testbed for PD's capstone visual themes feature: determining UI colors from a standalone XML file, instead of hard-coding into the program. (Eventually, failsafes will be added to ensure said XML file exists and is valid, etc, but for now, do not do weird things like delete PD's /Themes subfolder). This is a cumbersome project because I need to rework most controls to optimize how theme-specific colors are retrieved and applied. XML lookups are obviously slow inside of rendering code, so a new class - pdThemeColors - is used by each control to cache whatever color values they require. Inside the rendering loop, that class returns needed colors very quickly, without having to touch their original XML definitions. Similarly, if PD's visual theme is live-changed, the pdThemeColors class will handle caching the new colors, sparing the control from that kind of monotonous work. Similarly, a lot of PD's controls currently shortcut parts of the rendering process because the current "theme" decisions don't always require (for example) separate border and fill colors. In an ideal world, however, these colors *could* be defined inside a theme file, and PD should automatically pick up the new definitions and render accordingly. Finally, the actual theme file has to be slowly assembled according to the needs of each individual PD control, and color definitions have to be moved out of the code and into XML format. This is a tedious process, but a necessary one for easily supporting dark themes (and other accessibility-friendly variants). There's still some clean-up to do on the buttonStrip implementation, but so far it's proven to be a solid testbed for finding weaknesses and problems in PD's existing theming code. Once I'm confident that the new theming classes are all working as they should, I'll start converting PD's other custom controls to match.
- Loading branch information
1 parent
1888c36
commit b873321
Showing
9 changed files
with
282 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.