Sort menu: Show the current sort at the top of the menu

This commit is contained in:
Kovid Goyal 2022-02-07 14:41:16 +05:30
parent 78af40cf17
commit f4a1cdc98c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -126,6 +126,11 @@ class SortByAction(InterfaceAction):
if key == sort_col:
sac.setIcon(self.sorted_icon)
sac.sort_requested.connect(self.sort_requested)
if key == sort_col:
before = menu.actions()[0] if menu.actions() else None
menu.insertAction(before, sac)
menu.insertSeparator(before)
else:
menu.addAction(sac)
def choose_multisort(self):