Mercurial > hg > easyhg
annotate changesetitem.h @ 55:261bfb9481fe
* Make changeset item boxes wider if they have no neighbours.
Changeset item code is horrible -- items generally need
refactoring to take out hardcoded dimensions.
author | Chris Cannam |
---|---|
date | Fri, 12 Nov 2010 17:30:53 +0000 |
parents | 3c46b2ac45d3 |
children | f583e44d9d31 |
rev | line source |
---|---|
Chris@43 | 1 #ifndef CHANGESETITEM_H |
Chris@43 | 2 #define CHANGESETITEM_H |
Chris@43 | 3 |
Chris@43 | 4 #include <QGraphicsItem> |
Chris@53 | 5 #include <QFont> |
Chris@43 | 6 |
Chris@43 | 7 class Changeset; |
Chris@43 | 8 |
Chris@43 | 9 class ChangesetItem : public QGraphicsItem |
Chris@43 | 10 { |
Chris@43 | 11 public: |
Chris@53 | 12 ChangesetItem(Changeset *cs); |
Chris@43 | 13 |
Chris@43 | 14 virtual QRectF boundingRect() const; |
Chris@43 | 15 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); |
Chris@43 | 16 |
Chris@53 | 17 Changeset *getChangeset() { return m_changeset; } |
Chris@53 | 18 |
Chris@44 | 19 int column() const { return m_column; } |
Chris@44 | 20 int row() const { return m_row; } |
Chris@46 | 21 void setColumn(int c) { m_column = c; setX(c * 100); } |
Chris@53 | 22 void setRow(int r) { m_row = r; setY(r * 90); } |
Chris@44 | 23 |
Chris@55 | 24 bool isWide() const { return m_wide; } |
Chris@55 | 25 void setWide(bool w) { m_wide = w; } |
Chris@55 | 26 |
Chris@43 | 27 private: |
Chris@53 | 28 QFont m_font; |
Chris@43 | 29 Changeset *m_changeset; |
Chris@44 | 30 int m_column; |
Chris@44 | 31 int m_row; |
Chris@55 | 32 bool m_wide; |
Chris@43 | 33 }; |
Chris@43 | 34 |
Chris@43 | 35 #endif // CHANGESETITEM_H |