Blame view

build4/epsilon-master/apps/shared/store_title_cell.cpp 1.02 KB
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
27
28
29
30
  #include "store_title_cell.h"
  #include "hideable_even_odd_editable_text_cell.h"
  #include "escher/metric.h"
  
  namespace Shared {
  
  void StoreTitleCell::setSeparatorLeft(bool separator) {
    if (m_separatorLeft != separator) {
      m_separatorLeft = separator;
      reloadCell();
    }
  }
  
  void StoreTitleCell::drawRect(KDContext * ctx, KDRect rect) const {
    BufferFunctionTitleCell::drawRect(ctx, rect);
    // Draw the separator
    KDRect separatorRect(0, m_separatorLeft ? 0 : k_colorIndicatorThickness, Metric::TableSeparatorThickness, bounds().height() - (m_separatorLeft ? 0 : k_colorIndicatorThickness));
    if (m_separatorLeft) {
      ctx->fillRect(separatorRect, HideableEvenOddEditableTextCell::hideColor());
    } else {
      ctx->fillRect(separatorRect, backgroundColor());
    }
  }
  
  void StoreTitleCell::layoutSubviews() {
    KDRect textFrame = bufferTextViewFrame();
    bufferTextView()->setFrame(KDRect(textFrame.left() + Metric::TableSeparatorThickness, textFrame.top(), textFrame.width() - Metric::TableSeparatorThickness, textFrame.height()));
  }
  
  }