diff 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
line wrap: on
line diff
--- a/src/changesetitem.cpp	Mon Oct 17 16:25:02 2011 +0100
+++ b/src/changesetitem.cpp	Mon Oct 17 22:08:05 2011 +0100
@@ -38,7 +38,7 @@
 ChangesetItem::ChangesetItem(Changeset *cs) :
     m_changeset(cs), m_detail(0),
     m_showBranch(false), m_column(0), m_row(0), m_wide(false),
-    m_current(false), m_new(false)
+    m_current(false), m_closed(false), m_new(false)
 {
     m_font = QFont();
     m_font.setPixelSize(11);
@@ -262,10 +262,16 @@
 {
     paint->save();
     
+    int alpha = 255;
+    if (m_closed) alpha = 90;
+
     ColourSet *colourSet = ColourSet::instance();
     QColor branchColour = colourSet->getColourFor(m_changeset->branch());
     QColor userColour = colourSet->getColourFor(m_changeset->author());
 
+    branchColour.setAlpha(alpha);
+    userColour.setAlpha(alpha);
+
     QFont f(m_font);
 
     QTransform t = paint->worldTransform();
@@ -363,7 +369,10 @@
                                             fm, textwid);
     paint->drawText(x0 + 3, fm.ascent(), person);
 
-    paint->setPen(QPen(Qt::black));
+    QColor textColour = Qt::black;
+    textColour.setAlpha(alpha);
+
+    paint->setPen(QPen(textColour));
 
     QStringList tags = m_changeset->tags();
     if (!tags.empty()) {
@@ -427,11 +436,17 @@
 ChangesetItem::paintMerge(QPainter *paint)
 {
     paint->save();
+
+    int alpha = 255;
+    if (m_closed) alpha = 40;
     
     ColourSet *colourSet = ColourSet::instance();
     QColor branchColour = colourSet->getColourFor(m_changeset->branch());
     QColor userColour = colourSet->getColourFor(m_changeset->author());
 
+    branchColour.setAlpha(alpha);
+    userColour.setAlpha(alpha);
+
     QFont f(m_font);
 
     QTransform t = paint->worldTransform();