Mercurial > hg > easyhg
comparison src/changesetitem.cpp @ 510:c623ce6b3104
Refactor: make closed a changeset property (not a changeset item one)
author | Chris Cannam |
---|---|
date | Tue, 18 Oct 2011 11:30:00 +0100 |
parents | c43880dfdb78 |
children | 306a62fe851e |
comparison
equal
deleted
inserted
replaced
509:6f371814509d | 510:c623ce6b3104 |
---|---|
36 QImage *ChangesetItem::m_star = 0; | 36 QImage *ChangesetItem::m_star = 0; |
37 | 37 |
38 ChangesetItem::ChangesetItem(Changeset *cs) : | 38 ChangesetItem::ChangesetItem(Changeset *cs) : |
39 m_changeset(cs), m_detail(0), | 39 m_changeset(cs), m_detail(0), |
40 m_showBranch(false), m_column(0), m_row(0), m_wide(false), | 40 m_showBranch(false), m_column(0), m_row(0), m_wide(false), |
41 m_current(false), m_closed(false), m_closing(false), m_new(false) | 41 m_current(false), m_closing(false), m_new(false) |
42 { | 42 { |
43 m_font = QFont(); | 43 m_font = QFont(); |
44 m_font.setPixelSize(11); | 44 m_font.setPixelSize(11); |
45 m_font.setBold(false); | 45 m_font.setBold(false); |
46 m_font.setItalic(false); | 46 m_font.setItalic(false); |
255 ChangesetItem::isMerge() const | 255 ChangesetItem::isMerge() const |
256 { | 256 { |
257 return (m_changeset && m_changeset->parents().size() > 1); | 257 return (m_changeset && m_changeset->parents().size() > 1); |
258 } | 258 } |
259 | 259 |
260 bool | |
261 ChangesetItem::isClosed() const | |
262 { | |
263 return (m_changeset && m_changeset->closed()); | |
264 } | |
265 | |
260 void | 266 void |
261 ChangesetItem::paintNormal(QPainter *paint) | 267 ChangesetItem::paintNormal(QPainter *paint) |
262 { | 268 { |
263 paint->save(); | 269 paint->save(); |
264 | 270 |
265 int alpha = 255; | 271 int alpha = 255; |
266 if (m_closed) alpha = 90; | 272 if (isClosed()) alpha = 90; |
267 | 273 |
268 ColourSet *colourSet = ColourSet::instance(); | 274 ColourSet *colourSet = ColourSet::instance(); |
269 QColor branchColour = colourSet->getColourFor(m_changeset->branch()); | 275 QColor branchColour = colourSet->getColourFor(m_changeset->branch()); |
270 QColor userColour = colourSet->getColourFor(m_changeset->author()); | 276 QColor userColour = colourSet->getColourFor(m_changeset->author()); |
271 | 277 |
436 ChangesetItem::paintSimple(QPainter *paint) | 442 ChangesetItem::paintSimple(QPainter *paint) |
437 { | 443 { |
438 paint->save(); | 444 paint->save(); |
439 | 445 |
440 int alpha = 255; | 446 int alpha = 255; |
441 if (m_closed) alpha = 90; | 447 if (isClosed()) alpha = 90; |
442 | 448 |
443 ColourSet *colourSet = ColourSet::instance(); | 449 ColourSet *colourSet = ColourSet::instance(); |
444 QColor branchColour = colourSet->getColourFor(m_changeset->branch()); | 450 QColor branchColour = colourSet->getColourFor(m_changeset->branch()); |
445 QColor userColour = colourSet->getColourFor(m_changeset->author()); | 451 QColor userColour = colourSet->getColourFor(m_changeset->author()); |
446 | 452 |