[Bug]: Window control icons have poor contrast with dark frame and light toolbar themes on Linux

Open
#444 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp, linux
Domain
desktop

Research direction

Start with OpaqueBrowserFrameView::OnPaint() in chrome/browser/ui/views/frame/opaque_browser_frame_view.cc, which the issue identifies as a possible place to investigate. Trace which background color is passed to FrameCaptionButton::SetBackgroundColor() and compare it with the frame painted behind the controls. Reproduce with the supplied theme; done when the window control icons retain sufficient contrast as the toolbar color changes.

Written by the indexing model from the issue text.

Description

bug
Operating system

Linux

Version

Version 0.20.1.1 (Official Build, Chromium 156.0.8078.47) rpm (x86_64)

Have you tested that this is not an upstream issue or an issue with your configuration?
  • I have tried reproducing this issue in Chrome and it could not be reproduced there
  • I have tried reproducing this issue in ungoogled-chromium and it could not be reproduced there
  • I have tried reproducing this issue in Helium with a new and empty profile using --user-data-dir command line argument and it could not be reproduced there
Description

The minimize, maximize, and close icons are dark and barely visible when using a custom theme with a dark frame and a light toolbar. The controls appear over the dark frame, but their foreground color seems to be calculated using the light toolbar color.

Crash ID

No response

How to Reproduce?
  1. Load a custom theme using this minimal manifest.json:
    {
    "manifest_version": 3,
    "name": "Window Control Contrast Reproducer",
    "version": "1.0",
    "theme": {
    "colors": {
    "frame": [40, 70, 120],
    "frame_inactive": [55, 85, 135],
    "toolbar": [235, 239, 255],
    "toolbar_text": [0, 0, 0],
    "toolbar_button_icon": [0, 0, 0],
    "tab_text": [0, 0, 0],
    "tab_background_text": [230, 230, 230]
    }
    }
    }

  2. Observe the window controls with the window focused.

  3. Change only toolbar to [40, 70, 120] and reload the theme.

Actual behavior

With the light toolbar, the window control icons are dark and difficult to distinguish against the dark-blue frame.
Changing only the toolbar color to dark blue makes the window control icons white, even though the frame color remains unchanged. I confirmed this with my original theme.

Expected behavior

Window control icons should maintain sufficient contrast against the background actually painted behind them, independently of the toolbar color when the toolbar is not their background.

Additional context

Possible cause
The toolbar-color test suggests a mismatch between the background used to calculate caption-button contrast and the background actually drawn behind the buttons.
The controls appear over the dark frame, but their foreground color seems to be calculated using the light toolbar color. The minimize, maximize, and close icons are dark and barely visible when using a custom theme with a dark frame and a light toolbar.
A possible place to investigate is OpaqueBrowserFrameView::OnPaint() in chrome/browser/ui/views/frame/opaque_browser_frame_view.cc, particularly the selection between kColorToolbar and frame_color before calling FrameCaptionButton::SetBackgroundColor().
This is a suspected cause, not a verified source-level fix.

Dominant language
Shell
Stars
1.1k
Forks
63
Avg merge
28m
Merged PRs (30d)
11

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from imputnet/helium-linux

All issues in imputnet/helium-linux

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.