mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 16:57:31 +01:00
33 lines
967 B
C++
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();
|
|
}
|
|
|
|
|
|
}
|
|
|