fix(UI): Overhaul Rainbow Mode architecture #74

Merged
Zephyron merged 10 commits from fix/rainbow-mode into main 2025-12-23 03:20:49 +00:00
Collaborator

This commit completely re-architects the Rainbow Mode feature to eliminate the massive performance degradation previously experienced in the Configuration and Properties menus.

The issue was caused by a "Global Hammer" approach, where a 150ms timer forced the entire application to re-parse a 10,000+ character CSS string. This triggered expensive layout recalculations for every checkbox, slider, and label in the emulator, leading to exponential lag. In testing when it was originally implemented, it was not as bad as it currently is today. With the UI everchanging and additions being added to it, the lag only continued to get worse.

Changes:

  • Centralized rainbow logic into a new RainbowStyle (QProxyStyle) engine.

  • Implemented a "Static Shell" architecture: Dialogs now set their base theme exactly once using the user's chosen accent color for inner settings.

  • Restructured the animation to use a different approach: The rainbow timer now only updates the specific containers holding navigation buttons (sidebars and top tabs).

  • Added support for dynamic :pressed and :hover states, ensuring the rainbow effect remains consistent during user interaction without reverting to static colors.

The result is a fluid, high-refresh-rate rainbow animation on the primary navigation elements with effectively zero CPU impact on the rest of the UI.

This commit completely re-architects the Rainbow Mode feature to eliminate the massive performance degradation previously experienced in the Configuration and Properties menus. The issue was caused by a "Global Hammer" approach, where a 150ms timer forced the entire application to re-parse a 10,000+ character CSS string. This triggered expensive layout recalculations for every checkbox, slider, and label in the emulator, leading to exponential lag. In testing when it was originally implemented, it was not as bad as it currently is today. With the UI everchanging and additions being added to it, the lag only continued to get worse. Changes: - Centralized rainbow logic into a new RainbowStyle (QProxyStyle) engine. - Implemented a "Static Shell" architecture: Dialogs now set their base theme exactly once using the user's chosen accent color for inner settings. - Restructured the animation to use a different approach: The rainbow timer now only updates the specific containers holding navigation buttons (sidebars and top tabs). - Added support for dynamic :pressed and :hover states, ensuring the rainbow effect remains consistent during user interaction without reverting to static colors. The result is a fluid, high-refresh-rate rainbow animation on the primary navigation elements with effectively zero CPU impact on the rest of the UI.
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Signed-off-by: Collecting <collecting@noreply.localhost>
Collecting scheduled this pull request to auto merge when all checks succeed 2025-12-23 01:18:12 +00:00
Signed-off-by: Collecting <collecting@noreply.localhost>
Zephyron deleted branch fix/rainbow-mode 2025-12-23 03:20:49 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Citron/Emulator!74
No description provided.