Blame view

epsilon-master/escher/src/message_table_cell_with_expression.cpp 834 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/message_table_cell_with_expression.h>
  #include <escher/palette.h>
  
  MessageTableCellWithExpression::MessageTableCellWithExpression(I18n::Message message, KDText::FontSize size) :
    MessageTableCell(message, size),
    m_subtitleView(1.0f, 0.5f, Palette::GreyDark)
  {
  }
  
  View * MessageTableCellWithExpression::accessoryView() const {
    return (View *)&m_subtitleView;
  }
  
  void MessageTableCellWithExpression::setHighlighted(bool highlight) {
    MessageTableCell::setHighlighted(highlight);
    KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite;
    m_subtitleView.setBackgroundColor(backgroundColor);
  }
  
  void MessageTableCellWithExpression::setExpressionLayout(Poincare::ExpressionLayout * expressionLayout) {
    m_subtitleView.setExpressionLayout(expressionLayout);
    reloadCell();
    layoutSubviews();
  }