summaryrefslogtreecommitdiffstats
path: root/application/groupview/GroupView.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2019-08-20 02:58:27 +0200
committerPetr Mrázek <peterix@gmail.com>2019-08-20 02:58:27 +0200
commit1747f413b9d9a515d8ba6f583bba5985bad5636d (patch)
tree3b964f253d0f476fe89c1ff35e6f093cedf270b5 /application/groupview/GroupView.h
parent6d975748c0dd9ac89815fe5043c0d89b8e684bc7 (diff)
downloadMultiMC-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.h12
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;