Blame view

build3/escher/src/pointer_text_view.cpp 589 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
  #include <escher/pointer_text_view.h>
  #include <assert.h>
  
  PointerTextView::PointerTextView(KDText::FontSize size, const char * text, float horizontalAlignment, float verticalAlignment,
      KDColor textColor, KDColor backgroundColor) :
    TextView(size, horizontalAlignment, verticalAlignment, textColor, backgroundColor),
    m_text(text)
  {
  }
  
  void PointerTextView::setText(const char * text) {
    if (text != m_text) {
      m_text = text;
      markRectAsDirty(bounds());
    }
  }
  
  KDSize PointerTextView::minimalSizeForOptimalDisplay() const  {
    return KDText::stringSize(text(), m_fontSize);
  }