Mercurial > hg > easyhg
comparison src/changesetitem.cpp @ 506:470829a21f98
Identify closed branches and display them in a lighter shade
author | Chris Cannam |
---|---|
date | Mon, 17 Oct 2011 22:08:05 +0100 |
parents | 8bdc8f27d19c |
children | c43880dfdb78 |
comparison
equal
deleted
inserted
replaced
505:1c05e7576ea5 | 506:470829a21f98 |
---|---|
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_new(false) | 41 m_current(false), m_closed(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); |
260 void | 260 void |
261 ChangesetItem::paintNormal(QPainter *paint) | 261 ChangesetItem::paintNormal(QPainter *paint) |
262 { | 262 { |
263 paint->save(); | 263 paint->save(); |
264 | 264 |
265 int alpha = 255; | |
266 if (m_closed) alpha = 90; | |
267 | |
265 ColourSet *colourSet = ColourSet::instance(); | 268 ColourSet *colourSet = ColourSet::instance(); |
266 QColor branchColour = colourSet->getColourFor(m_changeset->branch()); | 269 QColor branchColour = colourSet->getColourFor(m_changeset->branch()); |
267 QColor userColour = colourSet->getColourFor(m_changeset->author()); | 270 QColor userColour = colourSet->getColourFor(m_changeset->author()); |
271 | |
272 branchColour.setAlpha(alpha); | |
273 userColour.setAlpha(alpha); | |
268 | 274 |
269 QFont f(m_font); | 275 QFont f(m_font); |
270 | 276 |
271 QTransform t = paint->worldTransform(); | 277 QTransform t = paint->worldTransform(); |
272 float scale = std::min(t.m11(), t.m22()); | 278 float scale = std::min(t.m11(), t.m22()); |
361 | 367 |
362 QString person = TextAbbrev::abbreviate(m_changeset->authorName(), | 368 QString person = TextAbbrev::abbreviate(m_changeset->authorName(), |
363 fm, textwid); | 369 fm, textwid); |
364 paint->drawText(x0 + 3, fm.ascent(), person); | 370 paint->drawText(x0 + 3, fm.ascent(), person); |
365 | 371 |
366 paint->setPen(QPen(Qt::black)); | 372 QColor textColour = Qt::black; |
373 textColour.setAlpha(alpha); | |
374 | |
375 paint->setPen(QPen(textColour)); | |
367 | 376 |
368 QStringList tags = m_changeset->tags(); | 377 QStringList tags = m_changeset->tags(); |
369 if (!tags.empty()) { | 378 if (!tags.empty()) { |
370 QStringList nonTipTags; | 379 QStringList nonTipTags; |
371 foreach (QString t, tags) { | 380 foreach (QString t, tags) { |
425 | 434 |
426 void | 435 void |
427 ChangesetItem::paintMerge(QPainter *paint) | 436 ChangesetItem::paintMerge(QPainter *paint) |
428 { | 437 { |
429 paint->save(); | 438 paint->save(); |
439 | |
440 int alpha = 255; | |
441 if (m_closed) alpha = 40; | |
430 | 442 |
431 ColourSet *colourSet = ColourSet::instance(); | 443 ColourSet *colourSet = ColourSet::instance(); |
432 QColor branchColour = colourSet->getColourFor(m_changeset->branch()); | 444 QColor branchColour = colourSet->getColourFor(m_changeset->branch()); |
433 QColor userColour = colourSet->getColourFor(m_changeset->author()); | 445 QColor userColour = colourSet->getColourFor(m_changeset->author()); |
446 | |
447 branchColour.setAlpha(alpha); | |
448 userColour.setAlpha(alpha); | |
434 | 449 |
435 QFont f(m_font); | 450 QFont f(m_font); |
436 | 451 |
437 QTransform t = paint->worldTransform(); | 452 QTransform t = paint->worldTransform(); |
438 float scale = std::min(t.m11(), t.m22()); | 453 float scale = std::min(t.m11(), t.m22()); |