Tk Source Code

View Ticket
Login
Ticket UUID: 089da4d261b9cdd31946c4cd80558e336d84c164
Title: minor visual modifications of ttk default style
Type: Patch Version: trunk
Submitter: emiliano Created on: 2024-07-25 00:20:37
Subsystem: 88. Themed Tk Assigned To: nemethi
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2024-08-07 20:04:36
Resolution: Fixed Closed By: fvogel
    Closed on: 2024-08-07 20:04:36
Description:
Ttk default theme has IMO two visual defects:

1 - ttk::scale doesn't show any visual feedback when the widget has focus. Since the widget has keyboard bindings, such visual feedback is expected.

2 - ttk::treeview is the only widget whose focus ring is black, which is a visual incosistency. Also, by default the focuswidth element option is 2, which looks "too wide". This is of course subjetive. I know ttk::entry also has a focuswidth of 2.
User Comments: fvogel added on 2024-08-07 20:04:36:
Thanks! (I have closed both the bugfix branch and this ticket).

nemethi (claiming to be Csaba Nemethi) added on 2024-08-07 19:32:46:

Merged, see commits [8b9354ee], [36d7cbec], and [3e6e89ab].


fvogel added on 2024-08-07 16:55:31:
Thanks, sounds OK for merging!

nemethi (claiming to be Csaba Nemethi) added on 2024-07-31 10:08:13:

Done, see commit [f55b88fc].


fvogel added on 2024-07-30 20:16:33:
Sure, please proceed?

nemethi (claiming to be Csaba Nemethi) added on 2024-07-30 12:07:07:
IMHO, the line

	    -focuswidth 1 -focuscolor $colors(-selectbg)

proposed by Emiliano should be inserted into the file altTheme.tcl, too.  Its "-focuscolor ..." part is in this case redundant, but harmless.

In addition, for consistency I propose the following change in the file clamTheme.tcl:  Append to

	ttk::style map Treeview \
	    ...

the line

	    -bordercolor [list focus $colors(-selectbg)]

which would draw a 1 pixel wide focus ring around the ttk::treeview widget, just like for ttk::combobox and ttk::spinbox.

fvogel added on 2024-07-26 20:23:10:

BTW, a simple script to check the visual effect is:

pack req Tk
ttk::style theme use default
pack [ttk::scale .s]
pack [ttk::button .b -text button]
pack [ttk::treeview .t]
focus -force .s  ; # problem 1
focus -force .t  ; # problem 2
# use <TAB> to switch focus between the three widgets


fvogel added on 2024-07-26 20:21:58:

Thanks, that's fine for me. Patch (against core-8-6-branch) committed in [62e11a8523].

If nobody complains I'll merge in a day or two.


Attachments: