Files
Upsilon/apps/graph/list/function_expression_cell.cpp
Émilie Feral f605963588 [apps/graph/list] Simplify funciton expression cell to be used by
sequence

Change-Id: I12f5e15c10544294292866b395066bc675b26067
2017-02-20 10:52:02 +01:00

52 lines
1.3 KiB
C++

#include "function_expression_cell.h"
#include <assert.h>
using namespace Poincare;
namespace Graph {
FunctionExpressionCell::FunctionExpressionCell() :
EvenOddCell(),
m_expressionView(ExpressionView())
{
}
void FunctionExpressionCell::setExpression(ExpressionLayout * expressionLayout) {
m_expressionView.setExpression(expressionLayout);
}
void FunctionExpressionCell::setTextColor(KDColor textColor) {
m_expressionView.setTextColor(textColor);
}
void FunctionExpressionCell::setEven(bool even) {
EvenOddCell::setEven(even);
m_expressionView.setBackgroundColor(backgroundColor());
}
void FunctionExpressionCell::setHighlighted(bool highlight) {
EvenOddCell::setHighlighted(highlight);
m_expressionView.setBackgroundColor(backgroundColor());
}
int FunctionExpressionCell::numberOfSubviews() const {
return 1;
}
View * FunctionExpressionCell::subviewAtIndex(int index) {
assert(index == 0);
return &m_expressionView;
}
void FunctionExpressionCell::layoutSubviews() {
KDRect expressionFrame(k_separatorThickness, 0, bounds().width() - k_separatorThickness, bounds().height());
m_expressionView.setFrame(expressionFrame);
}
void FunctionExpressionCell::drawRect(KDContext * ctx, KDRect rect) const {
// Color the separator
ctx->fillRect(KDRect(0, 0, k_separatorThickness, bounds().height()), Palette::GreyBright);
}
}