Files
Upsilon/escher/src/expression_table_cell_with_pointer.cpp
Émilie Feral d7091397e5 [escher] Rule of 5 in view
Change-Id: Iba04e9046845b544e184530562e34f831fce96f6
2017-05-24 15:32:22 +02:00

27 lines
912 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(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);
}