Tk Source Code

View Ticket
Login
2026-10-28
19:12 • Closed ticket [042da601]: Pendulum demo text not visible under dark mode plus 7 other changes artifact: cba88670 user: nemethi
19:00
Fix for [042da6013e]: Pendulum demo text not visible under dark mode check-in: e7514243 user: csaba tags: core-8-6-branch
18:20
Fix for [042da6013e]: Pendulum demo text not visible under dark mode check-in: 02bf07d1 user: csaba tags: core-9-0-branch
18:10
Fix for [042da6013e]: Pendulum demo text not visible under dark mode check-in: d005489a user: csaba tags: trunk, main
2026-10-26
13:15 • Ticket [042da601] Pendulum demo text not visible under dark mode status still Open with 3 other changes artifact: 1689260d user: serhiy.storchaka
12:44
Fix for [042da6013e]: give the demos colours which go with their background.

The pendulum demo gives its canvases a white background but leaves the text items at the default foreground, which under a dark appearance is white, so the caption and the axis labels could not be seen. Give those items a fill of their own, as the other demos were given one.

The widget demo colours its index links for a light background, which the text widget need not have: a #303080 link on a dark one cannot be read. Choose the set which goes with the background the text widget actually has, by the weighting tk_setPalette uses to decide between a black and a white foreground. closed check-in: 72d8eb47 user: serhiy.storchaka tags: demo-colors-dark-mode

2025-11-24
19:44 • Ticket [042da601] Pendulum demo text not visible under dark mode status still Open with 3 other changes artifact: 521893a1 user: chrstphrchvz
08:37 • Ticket [042da601]: 4 changes artifact: 957e5f87 user: jan.nijtmans
04:44
Fix [042da601]: Pendulum demo text not visible under dark mode leaf check-in: 865dcb36 user: chrstphrchvz tags: bug-042da601-c90b
04:43
Fix [042da601]: Pendulum demo text not visible under dark mode leaf check-in: 043f2d9c user: chrstphrchvz tags: bug-042da601-c86b
04:39 • New ticket [042da601] Pendulum demo text not visible under dark mode. artifact: cae428a7 user: chrstphrchvz

Ticket UUID: 042da6013e4af3e4c0eab98161ce50b11b705b42
Title: Pendulum demo text not visible under dark mode
Type: Bug Version: core-8-6-branch
Submitter: chrstphrchvz Created on: 2025-11-24 04:39:33
Subsystem: 76. Widget Tour Assigned To: chrstphrchvz
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-10-28 19:12:22
Resolution: Fixed Closed By: nemethi
    Closed on: 2026-10-28 19:12:22
Description:

The pendulum widget demo specifies the background color of the canvases to white, but leaves the canvas text items set to the default foreground color (which under dark mode is white). As a result, the text “Click to Adjust Bob Start Position” and phase space graph axis labels are not visible under dark mode.

User Comments: nemethi (claiming to be Csaba Nemethi) added on 2026-10-28 19:12:22:

Serhiy, many thanks! Merged into main, core-9-0-branch, and core-8-6-branch by commits [d005489a], [02bf07d1], and [e7514243].


serhiy.storchaka added on 2026-10-26 13:15:58:

Proposed fix in branch demo-colors-dark-mode [72d8eb4751]: the three text items get a fill of their own, so they no longer depend on a default foreground which a dark appearance inverts.

This is the conservative half of the question Jan raised: the white background stays, which is what the phase space graph needs for the reason Christopher gave, and only the items which had no colour of their own are given one. Dropping -background white from the pendulum canvas is still open, and would mean giving the rod and the pivot colours of their own as well.

The same commit does the equivalent for the widget demo's index, whose link colours were chosen for a white text widget and are unreadable on a dark one. It picks between two sets by the weighting tk_setPalette uses to choose a foreground, rather than assuming either.

The default ink is black, and on X11 it is the literal #000000, so nothing changes there. On Aqua and Windows it is NORMAL_FG, which follows the system, and that is where the items turned white against the white canvas.


chrstphrchvz added on 2025-11-24 19:44:35:

Maybe that is possible for the pendulum system canvas if the rod color is set to something other than black. But for the phase space graph canvas it’s easier to leave the background as white since it uses graphed lines which fade from black to white.


jan.nijtmans added on 2025-11-24 08:37:02:

Would it also be possible not to specify the background color to white any more, at least for 9.0+?