Skip to content

Fix log text color for dark mode and live theme switch#5060

Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
fix/dark-mode-log-text
Jul 8, 2026
Merged

Fix log text color for dark mode and live theme switch#5060
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
fix/dark-mode-log-text

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request improves how the application handles theming for log and output views, ensuring that colors and brushes adapt correctly to theme changes (such as switching between light and dark mode) at runtime. The changes introduce a new ThemeHelper utility, refactor brush resolution logic, and update UI components to recolor output lines dynamically when the theme changes.

The most important changes are:

Theme detection and brush resolution improvements:

  • Added a new static class ThemeHelper in src/UniGetUI.Avalonia/Infrastructure/ThemeHelper.cs to reliably determine the current theme variant and whether the app is in dark mode, resolving issues where theme detection could be inconsistent.
  • Refactored all theme and brush lookups in log/output-related view models and dialogs to use ThemeHelper for consistent theme resolution, replacing direct use of Application.Current.ActualThemeVariant.

Dynamic theme switching support:

  • Updated OperationOutputViewModel, OperationFailedDialog, OperationOutputWindow, and BaseLogPage to listen for theme changes (ActualThemeVariantChanged) and rebuild or reload their output lines with the correct brushes, so already-rendered output adapts instantly to theme switches.

Code cleanup and reliability:

  • Removed redundant or direct resource lookups in favor of the new centralized brush lookup logic, and cleaned up unused imports related to Avalonia theming.

These changes make the application's log and output views more visually reliable and responsive to theme changes, addressing previous issues with incorrect colors in dark mode.

@GabrielDuf Gabriel Dufresne (GabrielDuf) linked an issue Jul 8, 2026 that may be closed by this pull request
4 tasks
@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit c3cffd6 into main Jul 8, 2026
3 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the fix/dark-mode-log-text branch July 8, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Fix black text on dark mode

2 participants