|
From: Csaba N. <csa...@t-...> - 2025-12-05 16:32:39
|
Hi Brian,
1. To make sure that with the CheckTreeview style the checkbutton
indicators in the default and classic themes will be visible, please
proceed as follows:
- Insert the lines
ttk::style map Item -indicatorbackground \
[list selected $colors(-indicator)]
just before line #187 of the file library/ttk/defaults.tcl.
- Insert the lines
ttk::style map Item \
-indicatorcolor [list selected $colors(-indicator)] \
-indicatorrelief {selected sunken}
just before line #113 of the file library/ttk/classicTheme.tcl.
2. Is it intentional that with the CheckTreeview style the -striped
option has no effect?
3. I am still not happy with the appearance of the sort arrows. I have
looked into this issue again and found a much better solution, which
takes into account a few details of the way polygons are rendered by the
SVG engine. Here is the new version; I can guarantee you that it
improves the look of the sort arrows quite significantly:
set upArrowData [format {
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16" height="8" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<path d="m3.5 6.5 4.5 -4.5 4.5 4.5z" stroke="%s"
stroke-width="1" stroke-linejoin="round" fill="none"/>
</svg>} $fgColor]
image create photo arrowUp -format $::tk::svgFmt -data $upArrowData
set downArrowData [format {
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16" height="8" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<path d="m3.5 2.5 4.5 4.5 4.5 -4.5z" stroke="%s"
stroke-width="1" stroke-linejoin="round" fill="none"/>
</svg>} $fgColor]
image create photo arrowDown -format $::tk::svgFmt -data $downArrowData
Best regards,
Csaba
Am 05.12.25 um 02:37 schrieb Brian O'Hagan:
> Thanks for tracking that down. I'll get it fixed, though if you see my
> email to Torsten it should be a 1 pixel black focus ring.
>
> I could add the sort arrows to the widget like how is done on the Mac.
> That uses the user1 state as a flag for whether to show the built-in
> sort indicators. I could do the same for the other themes and it would
> be backwards compatible since people would need to add the user1 state
> to see the built-in indicators. Another benefit is it would free up the
> -image option for something else. I know some widgets have a filter
> image when a column has been filtered.
>
>
> On 12/4/25 12:38 PM, Csaba Nemethi wrote:
>> Hi Brian,
>>
>> 1. Regarding the "classic" theme: The reason for the missing focus
>> ring around the rows is the "-focuswidth 0" setting for the root style
>> ".". This mustn't be changed, but it should be overridden for the Row
>> style by inserting
>>
>> ttk::style configure Row -focuswidth 2
>>
>> just before line #110 of the file library/ttk/classicTheme.tcl. I
>> have tested it, it works as expected.
>>
>> 2. Regarding the sort arrows: In the file library/demos/treeview.tcl
>> I have changed the lines 695-696 to
>>
>> <svg width="16" height="4" version="1.1" xmlns="http://
>> www.w3.org/2000/svg">
>> <path d="m4 4 4 -4 4 4z" stroke="%s" stroke-width="1"
>> fill="none"/>
>>
>> and the lines 702-703 to
>>
>> <svg width="16" height="4" version="1.1" xmlns="http://
>> www.w3.org/2000/svg">
>> <path d="m4 0 4 4 4 -4z" stroke="%s" stroke-width="1"
>> fill="none"/>
>>
>> The resulting arrows appear vertically centered and look better than
>> before. Note that with this patch there is a padding *on both sides*
>> of the arrows. This makes sure that there will be a small gap between
>> the text and the arrows, even if the column's width becomes smaller.
>>
>> BTW: IMHO, the support for sort arrows should be a built-in
>> functionality of the treeview widget.
>>
>> Best regards,
>>
>> Csaba
>>
--
Csaba Nemethi https://www.nemethi.de mailto:csa...@t-...
|