Files
Upsilon/escher/src/expression_table_cell.cpp
Léa Saviot 4ad3adaab2 [apps/escher] Changed setExpression to setExpressionLayout.
Change-Id: I095a12868fd7eaf8d4eb2408617941a86f43e1ee
2018-01-15 11:58:01 +01:00

25 lines
745 B
C++

#include <escher/expression_table_cell.h>
#include <escher/palette.h>
#include <assert.h>
ExpressionTableCell::ExpressionTableCell(Layout layout) :
TableCell(layout),
m_labelExpressionView(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::setExpressionLayout(Poincare::ExpressionLayout * expressionLayout) {
m_labelExpressionView.setExpressionLayout(expressionLayout);
layoutSubviews();
}