Files
Upsilon/apps/shared/function_title_cell.cpp
Émilie Feral 5c8b5492e8 [apps/sequence/list] Improve cell rendering
Change-Id: I64e713a3beae2574593f96fa05717f346e5ffd07
2017-02-20 10:52:03 +01:00

29 lines
905 B
C++

#include "function_title_cell.h"
#include <assert.h>
namespace Shared {
FunctionTitleCell::FunctionTitleCell(Orientation orientation) :
EvenOddCell(),
m_orientation(orientation)
{
}
void FunctionTitleCell::setColor(KDColor color) {
m_functionColor = color;
reloadCell();
}
void FunctionTitleCell::drawRect(KDContext * ctx, KDRect rect) const {
if (m_orientation == Orientation::VerticalIndicator){
ctx->fillRect(KDRect(0, 0, k_colorIndicatorThickness, bounds().height()), m_functionColor);
} else {
ctx->fillRect(KDRect(0, 0, bounds().width(), k_colorIndicatorThickness), m_functionColor);
}
KDColor separatorColor = m_even ? Palette::WallScreen : KDColorWhite;
// Color the horizontal separator
ctx->fillRect(KDRect(k_colorIndicatorThickness, bounds().height()-k_separatorThickness, bounds().width()-k_colorIndicatorThickness, k_separatorThickness), separatorColor);
}
}