Xjph / ObservatoryCore

Elite Observatory: Extensible tool for processing Elite Dangerous journals
https://observatory.xjph.net/
MIT License
79 stars 13 forks source link

[Core] Some fixes to theming #147

Closed fredjk-gh closed 4 months ago

fredjk-gh commented 5 months ago

Fix a handful of issues with themes and theme switching:

  1. Panel Plugin UIs were not registered, and thus switching themes resulted in ugliness (ie. a partially applied theme; see "before" screenies below). Turns out they are root controls as well, so...
  2. When registering controls, now all root controls (not just the first) have their theme saved when registered to ensure all Light theme properties are captured. Light theme is now the Manager default (for populating the default light theme on registration) and then the dark theme is applied as last thing after all other initialization. (It remains a TODO to initialize the theme from settings.)
  3. Handle menu items properly -- which means saving their default light theme properties when registering the first one, and capturing them as into a list (like we do controls) and iterating that list when the theme is switched.

Before Light (the plugin menu items and much of the panel UI did not get applied correctly): Screenshot 2024-04-02 232021

Before Dark (notice dark theme is only partially applied to Panel UI): Screenshot 2024-04-02 224633

Fixed Light theme w/ Panel plugin: Screenshot 2024-04-03 010115

Fixed Dark theme w/ Panel plugin: Screenshot 2024-04-03 000218

Xjph commented 4 months ago

Inspired then obviated by cb098a787078eead763aa57e669bde3dc07edfca, closing.