diff options
author | Petr Mrázek <peterix@gmail.com> | 2019-08-20 02:58:27 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2019-08-20 02:58:27 +0200 |
commit | 1747f413b9d9a515d8ba6f583bba5985bad5636d (patch) | |
tree | 3b964f253d0f476fe89c1ff35e6f093cedf270b5 /application/groupview/GroupView.h | |
parent | 6d975748c0dd9ac89815fe5043c0d89b8e684bc7 (diff) | |
download | MultiMC-1747f413b9d9a515d8ba6f583bba5985bad5636d.tar MultiMC-1747f413b9d9a515d8ba6f583bba5985bad5636d.tar.gz MultiMC-1747f413b9d9a515d8ba6f583bba5985bad5636d.tar.lz MultiMC-1747f413b9d9a515d8ba6f583bba5985bad5636d.tar.xz MultiMC-1747f413b9d9a515d8ba6f583bba5985bad5636d.zip |
GH-851 save, load and use group expansion status
Diffstat (limited to 'application/groupview/GroupView.h')
-rw-r--r-- | application/groupview/GroupView.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/application/groupview/GroupView.h b/application/groupview/GroupView.h index db29a0d4..13bfd234 100644 --- a/application/groupview/GroupView.h +++ b/application/groupview/GroupView.h @@ -20,6 +20,7 @@ #include <QScrollBar> #include <QCache> #include "VisualGroup.h" +#include <functional> struct GroupViewRoles { @@ -41,6 +42,11 @@ public: void setModel(QAbstractItemModel *model) override; + using visibilityFunction = std::function<bool(const QString &)>; + void setSourceOfGroupCollapseStatus(visibilityFunction f) { + fVisibility = f; + } + /// return geometry rectangle occupied by the specified model item QRect geometryRect(const QModelIndex &index) const; /// return visual rectangle occupied by the specified model item @@ -48,8 +54,7 @@ public: /// get the model index at the specified visual point virtual QModelIndex indexAt(const QPoint &point) const override; QString groupNameAt(const QPoint &point); - void setSelection(const QRect &rect, - const QItemSelectionModel::SelectionFlags commands) override; + void setSelection(const QRect &rect, const QItemSelectionModel::SelectionFlags commands) override; virtual int horizontalOffset() const override; virtual int verticalOffset() const override; @@ -80,6 +85,7 @@ protected slots: signals: void droppedURLs(QList<QUrl> urls); + void groupStateChanged(QString group, bool collapsed); protected: virtual bool isIndexHidden(const QModelIndex &index) const override; @@ -103,6 +109,8 @@ private: friend struct VisualGroup; QList<VisualGroup *> m_groups; + visibilityFunction fVisibility; + // geometry int m_leftMargin = 5; int m_rightMargin = 5; |