Blame view

build3/escher/src/expression_table_cell.cpp 733 Bytes
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  #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::setExpression(Poincare::ExpressionLayout * expressionLayout) {
    m_labelExpressionView.setExpression(expressionLayout);
    layoutSubviews();
  }