beeware / beeware/toga

DetailedList doesn't honor `color` or `background-color` styles

Open
#4,444 5 comments 1 reaction 0 assignees View on GitHub
android bug gtk iOS linux macOS qt textual web windows
Dominant language
Python
Stars
5.4k
Forks
827
Avg merge
9h 45m
Merged PRs (30d)
58

Description

### Describe the bug

The DetailedList widget doesn't honor the `color` or `background-color` style directives.

### How to reproduce the bug

Modify the `examples/detailedlist` example so that the `self.dl = DetailedList(...)` widget created around L103 has colour-modifying style options (see example code below).

### Minimum example code

```shell
self.dl = DetailedList(
...
flex=1,
color="purple",
background_color="yellow",
)
```

### Environment details

- Operating system and version: All
- Python version: all (tested on 3.14)
- Software versions:
- Toga: 0.5.4+

### Additional context

A separate fix will be needed for each supported platform. The fix will involve:

1. Modifying the draw mechanism for the DetailedList widget to honour the current `color` and `background-color` style setting for the DetailedList widget (falling back to appropriate platform default colours)
2. Ensuring that `set_color` and `set_background_color` methods on DetailedList propagate onto the widgets
3. Enabling the `test_background_color`, `test_background_color_reset`, `test_color`, and `test_color_reset` tests for DetailedList in the testbed.
4. Ensuring that the probe backend for DetailedList has a mechanism to extract the current text and background color (and thus the testbed tests pass).

Contributor guide

Open the contributing guide

Research direction

Start with the DetailedList construction around L103 in examples/detailedlist, then trace its draw mechanism and set_color/set_background_color behavior on each supported platform. Enable test_background_color, test_background_color_reset, test_color, and test_color_reset in the DetailedList testbed, and inspect the probe backend's color extraction. Done means the tests pass with explicit styles and after resetting them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.