Commit 4c16d144 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Update bin sort menu when clicking in Bin headers.

Related to #583
parent ec3dd321
......@@ -2044,6 +2044,19 @@ void Bin::slotInitView(QAction *action)
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) {
connect(view, &MyTreeView::focusView, this, &Bin::slotGotFocus);
} else if (m_listType == BinIconView) {
Supports Markdown
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