mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-28 01:59:59 +01:00
[escher] Reorganize all cells'name and factorize their layouts
Change-Id: I69900ee98ff6a6868f96d70a0e335a589ef16c3f
This commit is contained in:
26
escher/src/expression_table_cell_with_pointer.cpp
Normal file
26
escher/src/expression_table_cell_with_pointer.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <escher/expression_table_cell_with_pointer.h>
|
||||
#include <escher/palette.h>
|
||||
#include <assert.h>
|
||||
|
||||
ExpressionTableCellWithPointer::ExpressionTableCellWithPointer(char * accessoryText, Layout layout) :
|
||||
ExpressionTableCell(layout),
|
||||
m_accessoryView(PointerTextView(KDText::FontSize::Small, accessoryText, 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::setAccessoryText(const char * text) {
|
||||
m_accessoryView.setText(text);
|
||||
}
|
||||
Reference in New Issue
Block a user