Mercurial > hg > easyhg
diff src/grapher.cpp @ 397:61bde1f0ff0a item_appearance_adjustments
Replace DateItems (background items for date shading) with a date range list in the scene and dedicated rendering for it in the graphics view: this way we can ensure the shading spans the full width and the dates are always visible
author | Chris Cannam |
---|---|
date | Wed, 25 May 2011 14:32:32 +0100 |
parents | 6718bbc073b4 |
children | b1f0fa991c49 |
line wrap: on
line diff
--- a/src/grapher.cpp Tue May 24 18:00:12 2011 +0100 +++ b/src/grapher.cpp Wed May 25 14:32:32 2011 +0100 @@ -17,7 +17,6 @@ #include "grapher.h" #include "connectionitem.h" -#include "dateitem.h" #include "debug.h" #include "changesetscene.h" @@ -581,13 +580,7 @@ if (date != prevDate) { if (prevDate != "") { - DateItem *item = new DateItem(); - item->setDateString(prevDate); - item->setCols(datemincol, datemaxcol - datemincol + 1); - item->setRows(changeRow, n); - item->setEven(even); - item->setZValue(-2); - m_scene->addDateItem(item); + m_scene->addDateRange(prevDate, changeRow, n, even); even = !even; } prevDate = date; @@ -597,14 +590,10 @@ } if (n > 0) { - DateItem *item = new DateItem(); - item->setDateString(prevDate); - item->setCols(datemincol, datemaxcol - datemincol + 1); - item->setRows(changeRow, n+1); - item->setEven(even); - item->setZValue(-2); - m_scene->addDateItem(item); + m_scene->addDateRange(prevDate, changeRow, n+1, even); even = !even; } + + m_scene->itemAddCompleted(); }