Mercurial > hg > easyhg
comparison changesetitem.cpp @ 133:aaeab914f2a3
* Better attempt at retaining current visible area when history scene changes; first cut at highlighting new items
| author | Chris Cannam |
|---|---|
| date | Tue, 30 Nov 2010 12:45:34 +0000 |
| parents | 16ceeee30e2a |
| children | bad40d7e7a2b |
comparison
equal
deleted
inserted
replaced
| 132:16ceeee30e2a | 133:aaeab914f2a3 |
|---|---|
| 26 #include <QGraphicsScene> | 26 #include <QGraphicsScene> |
| 27 #include <QGraphicsSceneMouseEvent> | 27 #include <QGraphicsSceneMouseEvent> |
| 28 | 28 |
| 29 ChangesetItem::ChangesetItem(Changeset *cs) : | 29 ChangesetItem::ChangesetItem(Changeset *cs) : |
| 30 m_changeset(cs), m_detail(0), | 30 m_changeset(cs), m_detail(0), |
| 31 m_showBranch(false), m_column(0), m_row(0), m_wide(false), m_current(false) | 31 m_showBranch(false), m_column(0), m_row(0), m_wide(false), |
| 32 m_current(false), m_new(false) | |
| 32 { | 33 { |
| 33 m_font = QFont(); | 34 m_font = QFont(); |
| 34 m_font.setPixelSize(11); | 35 m_font.setPixelSize(11); |
| 35 m_font.setBold(false); | 36 m_font.setBold(false); |
| 36 m_font.setItalic(false); | 37 m_font.setItalic(false); |
| 120 | 121 |
| 121 int height = 49; | 122 int height = 49; |
| 122 QRectF r(x0, 0, width - 3, height); | 123 QRectF r(x0, 0, width - 3, height); |
| 123 paint->drawRect(r); | 124 paint->drawRect(r); |
| 124 | 125 |
| 126 if (m_new) { | |
| 127 paint->save(); | |
| 128 paint->setPen(Qt::yellow); | |
| 129 paint->drawRect(QRectF(x0 - 2, -2, width + 1, height + 4)); | |
| 130 paint->restore(); | |
| 131 } | |
| 132 | |
| 125 if (m_current) { | 133 if (m_current) { |
| 126 paint->drawRect(QRectF(x0 - 4, -4, width + 5, height + 8)); | 134 paint->drawRect(QRectF(x0 - 4, -4, width + 5, height + 8)); |
| 127 } | 135 } |
| 128 | 136 |
| 129 if (scale < 0.1) { | 137 if (scale < 0.1) { |
