Numworks Epsilon  1.4.1
Graphing Calculator Operating System
message_table_cell.cpp
Go to the documentation of this file.
2 #include <escher/palette.h>
3 #include <assert.h>
4 
5 MessageTableCell::MessageTableCell(I18n::Message label, KDText::FontSize size, Layout layout) :
6  TableCell(layout),
7  m_messageTextView(size, label, 0, 0.5, KDColorBlack, KDColorWhite)
8 {
9 }
10 
12  return (View *)&m_messageTextView;
13 }
14 
15 void MessageTableCell::setHighlighted(bool highlight) {
17  KDColor backgroundColor = highlight? Palette::Select : KDColorWhite;
18  m_messageTextView.setBackgroundColor(backgroundColor);
19 }
20 
21 void MessageTableCell::setMessage(I18n::Message text) {
22  m_messageTextView.setMessage(text);
25 }
26 
28  m_messageTextView.setTextColor(color);
29 }
30 
32  m_messageTextView.setFontSize(fontSize);
34 }
void markRectAsDirty(KDRect rect)
Definition: view.cpp:39
View * labelView() const override
virtual void setTextColor(KDColor color)
constexpr KDColor KDColorWhite
Definition: color.h:42
static constexpr KDColor Select
Definition: palette.h:17
void setMessage(I18n::Message message)
constexpr KDColor KDColorBlack
Definition: color.h:41
virtual void setHighlighted(bool highlight) override
void setMessageFontSize(KDText::FontSize fontSize)
void layoutSubviews() override
Definition: table_cell.cpp:37
void setMessage(I18n::Message message)
Definition: color.h:6
Definition: view.h:23
void setTextColor(KDColor textColor)
Definition: text_view.cpp:19
virtual void setHighlighted(bool highlight)
void setFontSize(KDText::FontSize fontSize)
Definition: text_view.cpp:30
void setBackgroundColor(KDColor backgroundColor)
Definition: text_view.cpp:14
FontSize
Definition: text.h:10
KDRect bounds() const
Definition: view.cpp:157
MessageTableCell(I18n::Message label=(I18n::Message) 0, KDText::FontSize size=KDText::FontSize::Small, Layout layout=Layout::Horizontal)