summaryrefslogtreecommitdiff
authordrw <drw>2002-12-30 16:24:19 (UTC)
committer drw <drw>2002-12-30 16:24:19 (UTC)
commit74fae7e68acd91e61bdff6f7703021246a0c1fbc (patch) (side-by-side diff)
tree41e9fdb306e858644b3f15e5dbc0b204009136b2
parent627b209bfde5670061e9119a2c3038fa542c351c (diff)
downloadopie-74fae7e68acd91e61bdff6f7703021246a0c1fbc.zip
opie-74fae7e68acd91e61bdff6f7703021246a0c1fbc.tar.gz
opie-74fae7e68acd91e61bdff6f7703021246a0c1fbc.tar.bz2
Use background color for alternating transaction lines (like todo does now).
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/checkbook.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp
index 7a6b7cc..5fe660c 100644
--- a/noncore/apps/checkbook/checkbook.cpp
+++ b/noncore/apps/checkbook/checkbook.cpp
@@ -567,92 +567,92 @@ void Checkbook::drawCategoryChart( bool withdrawals )
tran = tranList->next();
DataPointInfo *cat;
for ( ; tran; tran = tranList->next() )
{
if ( tran->withdrawal() == withdrawals )
{
// Find category in list
for ( cat = list->first(); cat; cat = list->next() )
{
if ( cat->label() == tran->category() )
{
break;
}
}
if ( cat && cat->label() == tran->category() )
{ // Found category, add to transaction to category total
cat->addToValue( tran->amount() );
}
else
{ // Didn't find category, add category to list
list->append( new DataPointInfo( tran->category(), tran->amount() ) );
}
}
}
graphInfo = new GraphInfo( GraphInfo::PieChart, list );
}
CBListItem::CBListItem( QListView *parent, QString label1, QString label2,
QString label3, QString label4, QString label5, QString label6, QString label7,
QString label8 )
: QListViewItem( parent, label1, label2, label3, label4, label5, label6, label7, label8 )
{
m_known = FALSE;
owner = parent;
}
void CBListItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align )
{
QColorGroup _cg = cg;
const QPixmap *pm = listView()->viewport()->backgroundPixmap();
if ( pm && !pm->isNull() )
{
_cg.setBrush( QColorGroup::Base, QBrush( cg.base(), *pm ) );
p->setBrushOrigin( -listView()->contentsX(), -listView()->contentsY() );
}
else if ( isAltBackground() )
- _cg.setColor(QColorGroup::Base, QColor( 200, 255, 200 ) );
+ _cg.setColor(QColorGroup::Base, cg.background() );
QListViewItem::paintCell(p, _cg, column, width, align);
}
bool CBListItem::isAltBackground()
{
QListView *lv = static_cast<QListView *>( listView() );
if ( lv )
{
CBListItem *above = 0;
above = (CBListItem *)( itemAbove() );
m_known = above ? above->m_known : true;
if ( m_known )
{
m_odd = above ? !above->m_odd : false;
}
else
{
CBListItem *item;
bool previous = true;
if ( parent() )
{
item = (CBListItem *)( parent() );
if ( item )
previous = item->m_odd;
item = (CBListItem *)( parent()->firstChild() );
}
else
{
item = (CBListItem *)( lv->firstChild() );
}
while(item)
{
item->m_odd = previous = !previous;
item->m_known = true;
item = (CBListItem *)( item->nextSibling() );
}
}
return m_odd;
}
return false;
}