Files
Upsilon/escher/src/expression_table_cell_with_pointer.cpp
Hugo Saint-Vignes e27c668c40 [apps,escher,kandinsky,poincare,python] Replace every "grey" with "gray"
Change-Id: I60a232849dce90f70e6977b6024d6e9b1ce1b731
2020-11-04 15:07:20 +01:00

27 lines
1006 B
C++

#include <escher/expression_table_cell_with_pointer.h>
#include <escher/palette.h>
#include <assert.h>
ExpressionTableCellWithPointer::ExpressionTableCellWithPointer(Responder * parentResponder, I18n::Message accessoryMessage, Layout layout) :
ExpressionTableCell(parentResponder, layout),
m_accessoryView(KDFont::SmallFont, accessoryMessage, 0.0f, 0.5f, Palette::SecondaryText, Palette::ListCellBackground)
{
if (layout != Layout::Vertical) {
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::ListCellBackgroundSelected : Palette::ListCellBackground;
m_accessoryView.setBackgroundColor(backgroundColor);
}
void ExpressionTableCellWithPointer::setAccessoryMessage(I18n::Message text) {
m_accessoryView.setMessage(text);
}