Skip to content

Red text is barely legible when using a dark theme - #106

Merged
ashaduri merged 15 commits into
mainfrom
claude/fix-red-text-legibility
Mar 8, 2026
Merged

Red text is barely legible when using a dark theme#106
ashaduri merged 15 commits into
mainfrom
claude/fix-red-text-legibility

Conversation

@Claude

@Claude Claude AI commented Mar 4, 2026

Copy link
Copy Markdown
Contributor
  • Replace Gtk::Main::level() == 0 guard with null check on Gtk::Settings::get_default() in is_dark_theme_active() — fixes dark theme detection during initial UI construction (before Gtk::Main::run())
  • Add fallback #FF0000 in self-test error color path to always visually emphasize errors even if color lookup fails
Original prompt

This section details on the original issue you should resolve

<issue_title>Red text is barely legible when using a dark theme.</issue_title>
<issue_description>Version and Environment

  • GSmartControl version: [Are you using the latest released version or git?] 1.1.4
  • OS: [e.g. openSUSE Linux 15.4] Manjaro Gnome

Is your feature request related to a problem? Please describe.
Red text is barely legible, when using a dark theme like adw-gtk3-dark.

image

Describe the solution you'd like
A lighter red (closer to pink) text when using a dark theme.</issue_description>

Comments on the Issue (you are @claude[agent] in this section)


🔒 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.

Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Fix red text legibility in dark theme Fix red text legibility on dark GTK themes Mar 4, 2026
@ashaduri
ashaduri requested a review from Copilot March 6, 2026 14:24

This comment was marked as resolved.

- 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>
@Claude

This comment was marked as outdated.

@Claude Claude AI changed the title Fix red text legibility on dark GTK themes Addressing PR comments Mar 6, 2026
Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
@Claude

This comment was marked as outdated.

This comment was marked as resolved.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ashaduri ashaduri changed the title Addressing PR comments Red text is barely legible when using a dark theme Mar 7, 2026
@ashaduri
ashaduri requested a review from Copilot March 7, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread src/applib/warning_colors.h Outdated
Comment thread src/gui/gsc_info_window.cpp
@ashaduri

ashaduri commented Mar 7, 2026

Copy link
Copy Markdown
Owner

@copilot apply changes based on the comments in this thread

This comment was marked as resolved.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread src/applib/warning_colors.h Outdated
ashaduri and others added 10 commits March 7, 2026 17:39
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
@ashaduri
ashaduri marked this pull request as ready for review March 8, 2026 18:04
Copilot AI review requested due to automatic review settings March 8, 2026 18:04
@ashaduri
ashaduri merged commit 79f1c7d into main Mar 8, 2026
4 of 10 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

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>";
}

Copilot AI Mar 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>";

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Red text is barely legible when using a dark theme.

4 participants