Files
Upsilon/escher/src/even_odd_cell.cpp
Émilie Feral 2e16365100 [escher] Reorganize all cells'name and factorize their layouts
Change-Id: I69900ee98ff6a6868f96d70a0e335a589ef16c3f
2017-02-20 10:54:02 +01:00

26 lines
640 B
C++

#include <escher/even_odd_cell.h>
#include <escher/palette.h>
EvenOddCell::EvenOddCell() :
HighlightCell(),
m_even(false)
{
}
void EvenOddCell::setEven(bool even) {
m_even = even;
reloadCell();
}
KDColor EvenOddCell::backgroundColor() const {
// Select the background color according to the even line and the cursor selection
KDColor background = m_even ? KDColorWhite : Palette::WallScreen ;
background = isHighlighted() ? Palette::Select : background;
return background;
}
void EvenOddCell::drawRect(KDContext * ctx, KDRect rect) const {
KDColor background = backgroundColor();
ctx->fillRect(rect, background);
}