Files
Upsilon/apps/expression_editor/expression_editor_view.cpp
Léa Saviot c78efeeb59 [expression_editor] The user can input text.
Change-Id: I6456ee23e3caf3a42899d0734e1bef1f53f68b8d
2018-01-15 11:58:02 +01:00

33 lines
967 B
C++

#include "expression_editor_view.h"
#include <assert.h>
namespace ExpressionEditor {
ExpressionEditorView::ExpressionEditorView(Responder * parentResponder, Poincare::ExpressionLayout * expressionLayout, Poincare::ExpressionLayoutCursor * cursor) :
SolidColorView(KDColorWhite),
m_scrollableExpressionViewWithCursor(parentResponder, expressionLayout, cursor)
{
}
void ExpressionEditorView::cursorPositionChanged() {
m_scrollableExpressionViewWithCursor.expressionViewWithCursor()->cursorPositionChanged();
m_scrollableExpressionViewWithCursor.scrollToCursor();
}
void ExpressionEditorView::layoutSubviews() {
m_scrollableExpressionViewWithCursor.setFrame(KDRect(
k_margin,
k_margin,
bounds().width() - 2 * k_margin,
bounds().height() - 2 * k_margin));
markRectAsDirty(bounds());
}
KDSize ExpressionEditorView::minimalSizeForOptimalDisplay() const {
return m_scrollableExpressionViewWithCursor.minimalSizeForOptimalDisplay();
}
}