mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher] Create class ExpressionTableCellWithExpression
This commit is contained in:
@@ -21,6 +21,7 @@ objs += $(addprefix escher/src/,\
|
||||
even_odd_message_text_cell.o\
|
||||
expression_table_cell.o\
|
||||
expression_table_cell_with_pointer.o\
|
||||
expression_table_cell_with_expression.o\
|
||||
expression_view.o\
|
||||
highlight_cell.o\
|
||||
gauge_view.o\
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <escher/even_odd_message_text_cell.h>
|
||||
#include <escher/expression_table_cell.h>
|
||||
#include <escher/expression_table_cell_with_pointer.h>
|
||||
#include <escher/expression_table_cell_with_expression.h>
|
||||
#include <escher/expression_view.h>
|
||||
#include <escher/field.h>
|
||||
#include <escher/gauge_view.h>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef ESCHER_EXPRESSION_TABLE_CELL_WITH_EXPRESSION_H
|
||||
#define ESCHER_EXPRESSION_TABLE_CELL_WITH_EXPRESSION_H
|
||||
|
||||
#include <escher/expression_table_cell.h>
|
||||
#include <escher/i18n.h>
|
||||
|
||||
class ExpressionTableCellWithExpression : public ExpressionTableCell {
|
||||
public:
|
||||
ExpressionTableCellWithExpression();
|
||||
View * accessoryView() const override;
|
||||
void setHighlighted(bool highlight) override;
|
||||
void setAccessoryLayout(Poincare::Layout layoutR);
|
||||
private:
|
||||
ExpressionView m_accessoryExpressionView;
|
||||
};
|
||||
|
||||
#endif
|
||||
23
escher/src/expression_table_cell_with_expression.cpp
Normal file
23
escher/src/expression_table_cell_with_expression.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <escher/expression_table_cell_with_expression.h>
|
||||
#include <escher/palette.h>
|
||||
#include <assert.h>
|
||||
|
||||
ExpressionTableCellWithExpression::ExpressionTableCellWithExpression() :
|
||||
ExpressionTableCell(Layout::Horizontal),
|
||||
m_accessoryExpressionView(1.0f, 0.5f, KDColorBlack, KDColorWhite)
|
||||
{}
|
||||
|
||||
View * ExpressionTableCellWithExpression::accessoryView() const {
|
||||
return (View *)&m_accessoryExpressionView;
|
||||
}
|
||||
|
||||
void ExpressionTableCellWithExpression::setHighlighted(bool highlight) {
|
||||
ExpressionTableCell::setHighlighted(highlight);
|
||||
KDColor backgroundColor = highlight? Palette::Select : KDColorWhite;
|
||||
m_accessoryExpressionView.setBackgroundColor(backgroundColor);
|
||||
}
|
||||
|
||||
void ExpressionTableCellWithExpression::setAccessoryLayout(Poincare::Layout layoutR) {
|
||||
m_accessoryExpressionView.setLayout(layoutR);
|
||||
layoutSubviews();
|
||||
}
|
||||
Reference in New Issue
Block a user