Blame view

build3/escher/src/expression_table_cell_with_pointer.cpp 912 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
25
26
  #include <escher/expression_table_cell_with_pointer.h>
  #include <escher/palette.h>
  #include <assert.h>
  
  ExpressionTableCellWithPointer::ExpressionTableCellWithPointer(I18n::Message accessoryMessage, Layout layout) :
    ExpressionTableCell(layout),
    m_accessoryView(KDText::FontSize::Small, accessoryMessage, 0.0f, 0.5f, Palette::GreyDark, KDColorWhite)
  {
    if (layout == Layout::Horizontal) {
    	m_accessoryView.setAlignment(1.0f, 0.5f);
    }
  }
  
  View * ExpressionTableCellWithPointer::accessoryView() const {
    return (View *)&m_accessoryView;
  }
  
  void ExpressionTableCellWithPointer::setHighlighted(bool highlight) {
    ExpressionTableCell::setHighlighted(highlight);
    KDColor backgroundColor = highlight? Palette::Select : KDColorWhite;
    m_accessoryView.setBackgroundColor(backgroundColor);
  }
  
  void ExpressionTableCellWithPointer::setAccessoryMessage(I18n::Message text) {
    m_accessoryView.setMessage(text);
  }