even_odd_message_text_cell.cpp
1.11 KB
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
31
32
33
34
35
36
37
38
39
40
#include <escher/even_odd_message_text_cell.h>
#include <assert.h>
EvenOddMessageTextCell::EvenOddMessageTextCell(KDText::FontSize size) :
EvenOddCell(),
m_messageTextView(size, (I18n::Message)0, 0.5f, 0.5f)
{
}
void EvenOddMessageTextCell::setHighlighted(bool highlight) {
EvenOddCell::setHighlighted(highlight);
m_messageTextView.setBackgroundColor(backgroundColor());
}
void EvenOddMessageTextCell::setEven(bool even) {
EvenOddCell::setEven(even);
m_messageTextView.setBackgroundColor(backgroundColor());
}
void EvenOddMessageTextCell::setMessage(I18n::Message title, KDColor textColor) {
m_messageTextView.setMessage(title);
m_messageTextView.setTextColor(textColor);
}
void EvenOddMessageTextCell::setAlignment(float horizontalAlignment, float verticalAlignment) {
m_messageTextView.setAlignment(horizontalAlignment, verticalAlignment);
}
int EvenOddMessageTextCell::numberOfSubviews() const {
return 1;
}
View * EvenOddMessageTextCell::subviewAtIndex(int index) {
assert(index == 0);
return &m_messageTextView;
}
void EvenOddMessageTextCell::layoutSubviews() {
m_messageTextView.setFrame(bounds());
}