[Commits] [SCM] clawsker branch, master, updated. 1.3.5-5-g0f383cb

mones at claws-mail.org mones at claws-mail.org
Sun Jun 5 19:31:41 UTC 2022


The branch, master has been updated
       via  0f383cb950cfda50ffbe44e8c4fa1ad8d9e85131 (commit)
      from  1b1c90507e3795c94c92bf08607e00cee4830dd4 (commit)

Summary of changes:
 clawsker | 12 ++++++++++++
 1 file changed, 12 insertions(+)


- Log -----------------------------------------------------------------
commit 0f383cb950cfda50ffbe44e8c4fa1ad8d9e85131
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sun Jun 5 21:31:05 2022 +0200

    Fix RFE 4051: enable sortable columns on hotkeys
    
    Unfortunately the hidden column which defines oddity is also sorted
    along the visible column, so the alternating background color on rows is
    lost. The observed effect now is to be alternating more randomly. Not
    too bad, but not the ideal.
    
    Fixing this requires more investigation, because the oddity values can't
    be swapped within the sort function iself, it segfaults after some
    messages: Deep recursion on subroutine "Clawsker::store_sort"…

diff --git a/clawsker b/clawsker
index 8ff079d..df4557d 100755
--- a/clawsker
+++ b/clawsker
@@ -2327,6 +2327,13 @@ sub row_background_color {
         : $stylectx->get_background_color ('insensitive');
 }
 
+sub store_sort {
+    my ($store, $itera, $iterb, $sortkey) = @_;
+    my $a = $store->get($itera, $sortkey);
+    my $b = $store->get($iterb, $sortkey);
+    return $a cmp $b;
+}
+
 sub new_hotkeys_list {
     my ($gkey, $group) = @_;
     my $store = Gtk3::ListStore->new(
@@ -2373,6 +2380,11 @@ sub new_hotkeys_list {
             $renderer->set_property ('cell-background-rgba' => $bgcol);
         }
     );
+    for (0, 1) {
+        $store->set_sort_func($_, \&store_sort, $_);
+        my $col = $treeview->get_column($_);
+        $col->set_sort_column_id($_);
+    }
     # callback for saving current selection
     my $selection = $treeview->get_selection ();
     $selection->signal_connect ('changed' => sub { $SELHOTKEY = shift });

-----------------------------------------------------------------------


hooks/post-receive
-- 
Hidden preferences editor for Claws Mail


More information about the Commits mailing list