Files
Upsilon/escher/src/expression_table_cell_with_pointer.cpp
Émilie Feral 1f21251011 [escher] Change name: pointer->message
Change-Id: I0bd7a7d8da047b03342bec1ff31f29ad7efcc2f6
2017-03-16 15:12:12 +01:00

27 lines
929 B
C++

#include <escher/expression_table_cell_with_pointer.h>
#include <escher/palette.h>
#include <assert.h>
ExpressionTableCellWithPointer::ExpressionTableCellWithPointer(I18n::Message accessoryMessage, Layout layout) :
ExpressionTableCell(layout),
m_accessoryView(MessageTextView(KDText::FontSize::Small, accessoryMessage, 0.0f, 0.5f, Palette::GreyDark, KDColorWhite))
{
if (layout == Layout::Horizontal) {
m_accessoryView.setAlignment(1.0f, 0.5f);
}
}
View * ExpressionTableCellWithPointer::accessoryView() const {
return (View *)&m_accessoryView;
}
void ExpressionTableCellWithPointer::setHighlighted(bool highlight) {
ExpressionTableCell::setHighlighted(highlight);
KDColor backgroundColor = highlight? Palette::Select : KDColorWhite;
m_accessoryView.setBackgroundColor(backgroundColor);
}
void ExpressionTableCellWithPointer::setAccessoryMessage(I18n::Message text) {
m_accessoryView.setMessage(text);
}