Tk Source Code

View Ticket
Login
Ticket UUID: 0d48797195d9bd8e461bde3ecf1918305bffdaf9
Title: Ugly and inconsistent look of the focus element and active listbox item
Type: Bug Version: all
Submitter: nemethi Created on: 2024-07-28 10:53:34
Subsystem: 88. Themed Tk Assigned To: nemethi
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2024-08-06 08:22:51
Resolution: Fixed Closed By: nemethi
    Closed on: 2024-08-06 08:22:51
Description:

The focus element of the built-in themes default, alt, and clam is currently rather ugly and its rendering is inconsistent across the windowing systems x11, win32, and aqua, as seen in the screenshots contained in the left half of the attachment focusElement.png and its magnified version focusElement_x3.png.

  • x11: The dotted rectangle has both sharp and rounded corners, and the top-left corner contains two dots without a separating gap.
  • win32: What you get is an awfully looking dashed rectangle rather than a dotted one.
  • aqua: The dotted rectangle has both sharp and rounded corners.

As seen in the right side of the two attachments, it is possible to render the focus element in such a way that it has the same significantly improved look on the three windowing systems. The result is a decently looking dotted rounded rectangle.

A similar problem holds true regarding the look of the active item of a listbox widget having -activestyle dotbox. The modified code responsible for the improved look of the focus element can be used to solve this problem, too.

After uploading the above-mentioned attachments, I am going to create a branch containing the code that was the basis for the screenhots in the right half of the attachments and is also used for an improved rendering of the active listbox item.

User Comments: nemethi (claiming to be Csaba Nemethi) added on 2024-08-06 08:20:50:

Added focus indicator to the Toolbutton style, see commits [a495f343], [81bc2ab8], and [9702ef62].

Closing the ticket.


nemethi (claiming to be Csaba Nemethi) added on 2024-08-01 13:42:55:

@Emiliano: OK, I will add a focus indicator to the style Toolbutton.


emiliano added on 2024-08-01 00:52:57:
Csaba: thanks for taking care of these look and feel issues.

In order to not open another ticket, can you also address the lack of focus indicator in the Toolbutton style? It can be seen in the "Themed toolbar" demo: the "Button" and "Check" toolbar buttons has no visible focus indicator when they are focused in none of the standard themes.

nemethi (claiming to be Csaba Nemethi) added on 2024-07-31 15:43:35:

Done the merges, see commits [22d56237], [5ceee755], and [987db2cd].


fvogel added on 2024-07-30 20:23:33:
I can't try this for the moment, but your snapshots look very convincing and demonstrate your code is working. I'd encourage you to merge if you feel confident.

nemethi (claiming to be Csaba Nemethi) added on 2024-07-28 11:33:04:

No collision at all between my proposal and Emiliano's one.


nemethi (claiming to be Csaba Nemethi) added on 2024-07-28 11:28:42:

The proposed fix is in checkin [ec9aa473].


fvogel added on 2024-07-28 11:24:43:

Thanks.

Is there any fix collision between your proposal for the present ticket and what Emiliano proposed in [089da4d261], or can both tickets be dealt with in parallel independently?


Attachments: