|
From: Brian O'H. <bri...@co...> - 2025-12-06 22:51:20
|
Thanks. I've incorporated #1 and #3. The sort arrows are much nicer now.
For #2, no it's not intentional but instead a side effect of the button
states. The Check and Radio buttons use the alternate state to denote
the no value (aka tri-state or no on/off value is defined) state. Since
we don't set a value (we only use the selection state), then all items
get the alternate state. The current logic in ttkButton.c (see
CheckbuttonVariableChanged) doesn't allow a bypass for this without
setting an on/off value or defining a variable. It's open work to see if
there is another option.
On 12/5/25 10:32 AM, Csaba Nemethi wrote:
> 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
>>>
> |