python / cpython

The Python programming language
https://www.python.org
Other
62.29k stars 29.93k forks source link

IDLE fix colors for MacOS dark mode #86997

Open 919475b3-36a2-4cd7-997c-9c38f05f93c7 opened 3 years ago

919475b3-36a2-4cd7-997c-9c38f05f93c7 commented 3 years ago
BPO 42831
Nosy @terryjreedy, @taleinat, @E-Paine

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields: ```python assignee = 'https://github.com/terryjreedy' closed_at = None created_at = labels = ['easy', 'type-bug', '3.8', '3.9', '3.10', 'expert-IDLE'] title = 'IDLE fix colours for MacOS dark mode' updated_at = user = 'https://github.com/E-Paine' ``` bugs.python.org fields: ```python activity = actor = 'taleinat' assignee = 'terry.reedy' closed = False closed_date = None closer = None components = ['IDLE'] creation = creator = 'epaine' dependencies = [] files = [] hgrepos = [] issue_num = 42831 keywords = ['easy', 'newcomer friendly'] message_count = 3.0 messages = ['384391', '384416', '384420'] nosy_count = 3.0 nosy_names = ['terry.reedy', 'taleinat', 'epaine'] pr_nums = [] priority = 'normal' resolution = None stage = 'needs patch' status = 'open' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue42831' versions = ['Python 3.8', 'Python 3.9', 'Python 3.10'] ```

Linked PRs

919475b3-36a2-4cd7-997c-9c38f05f93c7 commented 3 years ago

Currently IDLE, in some places, uses predefined colours which assume it is in light mode. However, on the new Universal2 installers (I tested using 3.10.0a4) this causes issues, where this can no longer be assumed.

Taking the "About IDLE" dialogue as an example, it appears in a light theme and most notably makes button text very hard to read (as this is changed to white). I propose, on macOS systems running Tk >=8.6.10, we try to switch these colours to the system colours described in https://github.com/tcltk/tk/blob/main/macosx/README (IMO, we would test colour availability and catch a TclError rather than specifying conditions ourselves). For the about dialogue I think we would, for example, replace #bbbbbb with one of the systemWindowBackgroundColors.

terryjreedy commented 3 years ago

This might be related to #52197, about IDLE and KDE/GTK dark themes.

In general, IDLE only controls colors for Shell and editor windows, leaving dialogs to system default. This appears to be true for the settings and search dialogs. 'About' is unusual in having some colors specified. I had nothing to do with that. Would it work to just remove those specifications? Otherwise, every widget should specify both foreground and background color.

919475b3-36a2-4cd7-997c-9c38f05f93c7 commented 3 years ago

I have also done a grep and believe the other affected parts from the user's perspective are the debugger (I haven't checked if Mark's version also suffers), the help dialog and hover tip (e.g. over the squeezer button).

Would it work to just remove those specifications?

Almost certainly for the about dialog, though we would probably need to explicitly give the foreground colour for others (similar to what you did in PR 12262, I think)

tadeja commented 2 months ago

I can confirm this issue can be still seen with M1 MacOS 14.5 Dark mode in IDLE Debugger (Debug Control) on the current main branch (Python 3.14.0a0) where stack trace text is not visible as on the first screenshot.

Screenshot 2024-07-14 at 16 07 42

I would like to propose a change to specify foreground color of the stack trace. The result can be seen on the second screenshot below. Would this be fine? @terryjreedy

Screenshot 2024-07-14 at 16 13 01

"About IDLE" and Help dialogue do not seem to be affected anymore (or I'm not seeing it).