Red text is barely legible when using a dark theme - #106
Merged
Conversation
Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
- Guard theme detection with Gtk::Main::level() check to avoid crashes in non-GUI executables - Use narrow headers (gtkmm/settings.h, gtkmm/main.h) instead of umbrella gtkmm.h - Return early from app_property_get_label_highlight_color() for WarningLevel::None Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Owner
|
@copilot apply changes based on the comments in this thread |
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
- Guard theme detection with Gtk::Main::level() check to avoid crashes in non-GUI executables - Use narrow headers (gtkmm/settings.h, gtkmm/main.h) instead of umbrella gtkmm.h - Return early from app_property_get_label_highlight_color() for WarningLevel::None Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…into claude/fix-red-text-legibility # Conflicts: # src/applib/warning_colors.h # src/gui/gsc_info_window.cpp
Comment on lines
+2450
to
+2453
| // Use the same color as Alert level warnings for consistency | ||
| if (app_property_get_label_highlight_color(WarningLevel::Alert, alert_color) && !alert_color.empty()) { | ||
| result_main_msg = "<span color=\"" + alert_color + "\">"s + result_main_msg + "</span>"; | ||
| } |
There was a problem hiding this comment.
In the self-test error highlighting path, app_property_get_label_highlight_color is being called with the old signature (missing the new dark_mode boolean). This will fail to compile after the API change in warning_colors.h. Also, if the color lookup fails, the message is left uncolored, but the PR description indicates there should be a #FF0000 fallback to ensure errors are always emphasized. Update the call to pass gui_is_dark_theme_active() (or a cached dark_mode) and apply a #FF0000 fallback when the lookup fails/returns empty.
Suggested change
| // Use the same color as Alert level warnings for consistency | |
| if (app_property_get_label_highlight_color(WarningLevel::Alert, alert_color) && !alert_color.empty()) { | |
| result_main_msg = "<span color=\"" + alert_color + "\">"s + result_main_msg + "</span>"; | |
| } | |
| const bool dark_mode = gui_is_dark_theme_active(); | |
| // Use the same color as Alert level warnings for consistency, | |
| // falling back to red if lookup fails or returns empty. | |
| if (!app_property_get_label_highlight_color(WarningLevel::Alert, dark_mode, alert_color) || alert_color.empty()) { | |
| alert_color = "#FF0000"; | |
| } | |
| result_main_msg = "<span color=\"" + alert_color + "\">"s + result_main_msg + "</span>"; |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gtk::Main::level() == 0guard with null check onGtk::Settings::get_default()inis_dark_theme_active()— fixes dark theme detection during initial UI construction (beforeGtk::Main::run())#FF0000in self-test error color path to always visually emphasize errors even if color lookup failsOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.