Update bin sort menu when clicking in Bin headers.

Related to #583
parent 534cfb9b
Pipeline #20588 passed with stage
in 9 minutes and 31 seconds
......@@ -2055,6 +2055,19 @@ void Bin::slotInitView(QAction *action)
m_showRating->setChecked(!view->isColumnHidden(7));
connect(view->header(), &QHeaderView::sectionResized, this, &Bin::slotSaveHeaders);
connect(view->header(), &QHeaderView::sectionClicked, this, &Bin::slotSaveHeaders);
connect(view->header(), &QHeaderView::sortIndicatorChanged, [this] (int ix, Qt::SortOrder order) {
QSignalBlocker bk(m_sortDescend);
QSignalBlocker bk2(m_sortGroup);
m_sortDescend->setChecked(order == Qt::DescendingOrder);
QList <QAction*> actions = m_sortGroup->actions();
for (auto ac : actions) {
if (ac->data().toInt() == ix) {
ac->setChecked(true);
break;
}
}
});
connect(view, &MyTreeView::focusView, this, &Bin::slotGotFocus);
} else if (m_listType == BinIconView) {
m_itemView->setItemDelegate(m_binListViewDelegate);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment