summaryrefslogtreecommitdiffstats
path: root/Group.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-02-04 00:40:10 +0100
committerPetr Mrázek <peterix@gmail.com>2014-02-04 00:40:10 +0100
commit946d49675cb4725c31ab49a51f3bcae302f89a19 (patch)
tree8b1ffe190cbd75d2e8940b69d1413f755dfbea2e /Group.h
parentddedd077b66f2bf45cd157d760eebdad15bcb289 (diff)
downloadMultiMC-946d49675cb4725c31ab49a51f3bcae302f89a19.tar
MultiMC-946d49675cb4725c31ab49a51f3bcae302f89a19.tar.gz
MultiMC-946d49675cb4725c31ab49a51f3bcae302f89a19.tar.lz
MultiMC-946d49675cb4725c31ab49a51f3bcae302f89a19.tar.xz
MultiMC-946d49675cb4725c31ab49a51f3bcae302f89a19.zip
Swap things around -- rename refactors, moving towards non-derpy design. Maybe.
Diffstat (limited to 'Group.h')
-rw-r--r--Group.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/Group.h b/Group.h
index 51e0470d..455ee1a8 100644
--- a/Group.h
+++ b/Group.h
@@ -10,22 +10,38 @@ class QModelIndex;
struct Group
{
+/* constructors */
Group(const QString &text, GroupView *view);
Group(const Group *other);
+
+/* data */
GroupView *view;
QString text;
bool collapsed;
QVector<int> rowHeights;
- int firstRow;
+ int firstItemIndex;
+/* logic */
+ /// do stuff. and things. TODO: redo.
void update();
+ /// draw the header at y-position.
void drawHeader(QPainter *painter, const int y);
+
+ /// height of the group, in total. includes a small bit of padding.
int totalHeight() const;
+
+ /// height of the group header, in pixels
int headerHeight() const;
+
+ /// height of the group content, in pixels
int contentHeight() const;
+
+ /// the number of visual rows this group has
int numRows() const;
- int top() const;
+
+ /// the height at which this group starts, in pixels
+ int verticalPosition() const;
enum HitResult
{
@@ -37,9 +53,12 @@ struct Group
};
Q_DECLARE_FLAGS(HitResults, HitResult)
- HitResults pointIntersect (const QPoint &pos) const;
+ /// shoot! BANG! what did we hit?
+ HitResults hitScan (const QPoint &pos) const;
+ /// super derpy thing.
QList<QModelIndex> items() const;
+ /// I don't even
int numItems() const;
QModelIndex firstItem() const;
QModelIndex lastItem() const;