Blame view

build6/epsilon-master/apps/shared/function_title_cell.cpp 1.07 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 "function_title_cell.h"
  #include <assert.h>
  
  namespace Shared {
  
  FunctionTitleCell::FunctionTitleCell(Orientation orientation) :
    EvenOddCell(),
    m_orientation(orientation)
  {
  }
  
  void FunctionTitleCell::setColor(KDColor color) {
    m_functionColor = color;
    reloadCell();
  }
  
  void FunctionTitleCell::drawRect(KDContext * ctx, KDRect rect) const {
    if (m_orientation == Orientation::VerticalIndicator){
      ctx->fillRect(KDRect(0, 0, k_colorIndicatorThickness, bounds().height()), m_functionColor);
      // Color the vertical separator
      ctx->fillRect(KDRect(bounds().width()-k_separatorThickness, 0, k_separatorThickness, bounds().height()), Palette::GreyBright);
      KDColor separatorColor = m_even ? Palette::WallScreen : KDColorWhite;
      // Color the horizontal separator
      ctx->fillRect(KDRect(k_colorIndicatorThickness, bounds().height()-k_separatorThickness, bounds().width()-k_colorIndicatorThickness-k_separatorThickness, k_separatorThickness), separatorColor);
    } else {
      ctx->fillRect(KDRect(0, 0, bounds().width(), k_colorIndicatorThickness), m_functionColor);
    }
  }
  
  }