Files
Upsilon/escher/src/expression_table_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

25 lines
749 B
C++

#include <escher/expression_table_cell.h>
#include <escher/palette.h>
#include <assert.h>
ExpressionTableCell::ExpressionTableCell(Layout layout) :
TableCell(layout),
m_labelExpressionView(ExpressionView(0.0f, 0.5f, KDColorBlack, KDColorWhite))
{
}
View * ExpressionTableCell::labelView() const {
return (View *)&m_labelExpressionView;
}
void ExpressionTableCell::setHighlighted(bool highlight) {
TableCell::setHighlighted(highlight);
KDColor backgroundColor = highlight? Palette::Select : KDColorWhite;
m_labelExpressionView.setBackgroundColor(backgroundColor);
}
void ExpressionTableCell::setExpression(Poincare::ExpressionLayout * expressionLayout) {
m_labelExpressionView.setExpression(expressionLayout);
layoutSubviews();
}