• tablelist: size of columns when sorting and location of sort arrow

    From Ralf Fassel@21:1/5 to All on Tue Nov 16 16:29:39 2021
    tablelist 6.15.1 on linux,
    tcl 8.6.12

    Script:
    # make a wide window
    wm geometry . 1000x200
    package require tablelist
    # two columns, right and left aligned
    pack [tablelist::tablelist .t -columns {0 c1 r 0 c2 l}] -fill both -expand yes
    # stretch them equally
    .t configure -stretch all
    # columns are sortable
    .t columnconfigure 0 -labelcommand tablelist::sortByColumn
    .t columnconfigure end -labelcommand tablelist::sortByColumn
    # add something to sort
    .t insert end {c11 c12}
    .t insert end {c21 c22}

    At the start, the two columns have equal with.
    But when I sort them by clicking on either header label, there are two issues:

    - the size of the sorted-by column is enlarged
    - the sort-indication-arrow is placed at the 'other' (regarding the text
    of the label) end of the column header which makes it hard to spot /
    easy to miss if the label text is short and the column is wide

    Q: Is the placement of the sort-arrow somehow configurable (I'd rather have
    it near the text, either in front of it, or just after it)?

    And IMHO the arrow should not add to the column weight/width when
    calculating the new column width for stretchable columns.

    TNX
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nemethi@21:1/5 to All on Tue Nov 16 18:25:37 2021
    Am 16.11.21 um 16:29 schrieb Ralf Fassel:
    tablelist 6.15.1 on linux,
    tcl 8.6.12

    Script:
    # make a wide window
    wm geometry . 1000x200
    package require tablelist
    # two columns, right and left aligned
    pack [tablelist::tablelist .t -columns {0 c1 r 0 c2 l}] -fill both -expand yes
    # stretch them equally
    .t configure -stretch all
    # columns are sortable
    .t columnconfigure 0 -labelcommand tablelist::sortByColumn
    .t columnconfigure end -labelcommand tablelist::sortByColumn
    # add something to sort
    .t insert end {c11 c12}
    .t insert end {c21 c22}

    At the start, the two columns have equal with.
    But when I sort them by clicking on either header label, there are two issues:

    - the size of the sorted-by column is enlarged
    - the sort-indication-arrow is placed at the 'other' (regarding the text
    of the label) end of the column header which makes it hard to spot /
    easy to miss if the label text is short and the column is wide

    Q: Is the placement of the sort-arrow somehow configurable (I'd rather have it near the text, either in front of it, or just after it)?

    And IMHO the arrow should not add to the column weight/width when
    calculating the new column width for stretchable columns.

    TNX
    R'


    The placement of the sort arrow is not configurable. If the column is left-aligned or centered then the arrow is placed at the right edge of
    the header label, else (if the column is right-aligned) at its left
    edge, just like in the GNOME file manager Nautilus (Dolphin on KDE and
    Finder on the Mac always place the arrow at the right edge). On Windows
    the sort arrow is placed in the center of the header label, above the
    text, just like in the native Windows applications.

    If the column's width is 0 (i.e., dynamic) then IMHO it is logical to
    make room for the sort arrow by enlarging the column if needed (and to
    take into account the arrow's width, too, when stretching the columns).
    Otherwise we would have to trim the label's text, which would not be
    in sync with the definition of the dynamic-width columns.

    --
    Csaba Nemethi https://www.nemethi.de mailto:csaba.nemethi@t-online.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Wed Nov 17 11:33:35 2021
    * nemethi <csaba.nemethi@t-online.de>
    | Am 16.11.21 um 16:29 schrieb Ralf Fassel:
    | > Q: Is the placement of the sort-arrow somehow configurable (I'd rather have | > it near the text, either in front of it, or just after it)?
    --<snip-snip>--

    | The placement of the sort arrow is not configurable.
    [adapted to OS or Desktop convention]

    Ok.

    Again, thanks very much for the tablelist package, Csaba!
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)