mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
The Toolbox did not always redraw itself when needed (for instance, when going back from the For submenu in the Code Toolbox). Change-Id: I157b883e321a497b4b958aae53c4e8406bad1725
35 lines
974 B
C++
35 lines
974 B
C++
#include <escher/message_table_cell.h>
|
|
#include <escher/palette.h>
|
|
#include <assert.h>
|
|
|
|
MessageTableCell::MessageTableCell(I18n::Message label, KDText::FontSize size, Layout layout) :
|
|
TableCell(layout),
|
|
m_messageTextView(size, label, 0, 0.5, KDColorBlack, KDColorWhite)
|
|
{
|
|
}
|
|
|
|
View * MessageTableCell::labelView() const {
|
|
return (View *)&m_messageTextView;
|
|
}
|
|
|
|
void MessageTableCell::setHighlighted(bool highlight) {
|
|
HighlightCell::setHighlighted(highlight);
|
|
KDColor backgroundColor = highlight? Palette::Select : KDColorWhite;
|
|
m_messageTextView.setBackgroundColor(backgroundColor);
|
|
}
|
|
|
|
void MessageTableCell::setMessage(I18n::Message text) {
|
|
m_messageTextView.setMessage(text);
|
|
layoutSubviews();
|
|
markRectAsDirty(bounds());
|
|
}
|
|
|
|
void MessageTableCell::setTextColor(KDColor color) {
|
|
m_messageTextView.setTextColor(color);
|
|
}
|
|
|
|
void MessageTableCell::setMessageFontSize(KDText::FontSize fontSize) {
|
|
m_messageTextView.setFontSize(fontSize);
|
|
layoutSubviews();
|
|
}
|