| Ticket UUID: | 4468ed16d3e08d5303b3df1f958bd1a38713a3cd | |||
| Title: | Iconlist: do not use options database for initial foreground text color | |||
| Type: | Patch | Version: | 8.6.13 | |
| Submitter: | chrstphrchvz | Created on: | 2023-08-22 15:44:48 | |
| Subsystem: | 37. [tk_get*File] | Assigned To: | fvogel | |
| Priority: | 5 Medium | Severity: | Important | |
| Status: | Closed | Last Modified: | 2023-09-03 18:58:41 | |
| Resolution: | Fixed | Closed By: | fvogel | |
| Closed on: | 2023-09-03 18:58:41 | |||
| Description: |
Iconlist is used by e.g. tk_getOpenFile on X11 (available as ::tk::dialog::file:: open even on non-X11). [795717] intended to make iconlist’s text foreground color follow the options database, since the canvas background color did so as well. But then in [2125f1d1a2], the canvas background was hardcoded to white, and the text foreground color when an icon became unselected was hardcoded to black. This left an inconsistency where the initial text foreground color can still be set to a light color by the options database rather than always black, as encountered by those using tk_setPalette ([09cc54e910]) or dark system theming (https://github.com/python/cpython/issues/100584). The attached patch avoids this issue by hardcoding $fill to black, and then consistently using $fill as the text foreground color. I would not bother with instead reintroducing additional options database usage. Because of TIP 645 ([51915018a9]), this bug is not present in 8.7. | |||
| User Comments: |
fvogel added on 2023-09-03 18:58:41:
Fix merged in core-8-6-branch (only - this does not apply to trunk). Thanks! fvogel added on 2023-09-02 10:20:11: Generally speaking, long-standing buggy behaviors shall be fixed. I did not mean to say that the single fact something was done a long time ago is enough as an argument to never change it. When it's a bug it shall be fixed. In this specific case I had doubts but the additional information you have just given about the behavior when selecting/unselecting convinces me it's buggy enough to justify fixing it a maintenance release. chrstphrchvz added on 2023-09-02 09:57:17: …So far I have successfully rectified a few different longstanding behaviors in 8.6, but I hesitate to appeal to such precedent if doing so will prompt those other changes to be deferred to 8.7 and reverted in 8.6. chrstphrchvz added on 2023-09-02 09:53:51: Correct, I do not intend for this to affect 8.7. The only change from the existing 8.6 behavior is when the default canvas foreground text color has been overridden in the options database. While it is possible that someone may have chosen a color which does contrast well with the hardcoded white background color, their choice already gets undone when the user selecting and then unselecting a file, causing the text to appear black. I do not consider this inconsistency between initial and post-unselection text colors something Tk should keep even in 8.6. fvogel added on 2023-09-02 09:38:03: Thank you. Patch now committed in a bugfix branch as [22bed29e7e] for evaluation. In my understanding, you propose to merge this in core-8-6-branch, where the options database would now be ignored, but not in trunk (because TIP #645 is the 8.7 solution for the problem at stake). I'm mixed: on one hand the patch actually provides a fix at least for [09cc54e910], and perhaps a "won't fix in 8.6 - please use 8.7" for [9b9dfab871]. On the other hand it changes a behaviour established for 10-15 years since the relevant setting from the options database would now be ignored. Can we do this in a maintenance release of 8.6? It depends on the balance between gains and losses provided by the patch, which I'm not sure how to evaluate. | |||
Attachments:
- 4468ed16d3.diff [download] added by chrstphrchvz on 2023-08-22 15:45:46. [details]
