Files
Upsilon/escher/src/expression_table_cell.cpp
2020-02-12 17:42:58 +01:00

33 lines
1.0 KiB
C++

#include <escher/expression_table_cell.h>
#include <escher/container.h>
#include <escher/palette.h>
#include <assert.h>
ExpressionTableCell::ExpressionTableCell(Responder * parentResponder, Layout layout) :
Responder(parentResponder),
TableCell(layout),
m_labelExpressionView(this, k_horizontalMargin, 0, 0.0f, 0.5f, Palette::PrimaryText, Palette::ListCellBackground)
{
}
View * ExpressionTableCell::labelView() const {
return (View *)&m_labelExpressionView;
}
void ExpressionTableCell::setHighlighted(bool highlight) {
TableCell::setHighlighted(highlight);
KDColor backgroundColor = highlight? Palette::ListCellBackgroundSelected : Palette::ListCellBackground;
m_labelExpressionView.setBackgroundColor(backgroundColor);
}
void ExpressionTableCell::setLayout(Poincare::Layout layout) {
m_labelExpressionView.setLayout(layout);
if (!layout.isUninitialized()) {
layoutSubviews();
}
}
void ExpressionTableCell::didBecomeFirstResponder() {
Container::activeApp()->setFirstResponder(&m_labelExpressionView);
}