mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 09:17:23 +01:00
[apps/sequence] Make controllers inherit from StorageFunction controllers when required
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "term_sum_controller.h"
|
||||
#include "../../shared/text_field_delegate.h"
|
||||
#include "../app.h"
|
||||
#include <poincare/code_point_layout.h>
|
||||
#include <poincare/horizontal_layout.h>
|
||||
#include <poincare/vertical_offset_layout.h>
|
||||
@@ -18,7 +17,7 @@ using namespace Poincare;
|
||||
namespace Sequence {
|
||||
|
||||
TermSumController::TermSumController(Responder * parentResponder, ::InputEventHandlerDelegate * inputEventHandlerDelegate, GraphView * graphView, CurveViewRange * graphRange, CurveViewCursor * cursor) :
|
||||
SumGraphController(parentResponder, inputEventHandlerDelegate, graphView, graphRange, cursor, UCodePointNArySummation)
|
||||
StorageSumGraphController(parentResponder, inputEventHandlerDelegate, graphView, graphRange, cursor, UCodePointNArySummation)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -30,7 +29,7 @@ bool TermSumController::moveCursorHorizontallyToPosition(double position) {
|
||||
if (position < 0.0) {
|
||||
return false;
|
||||
}
|
||||
return SumGraphController::moveCursorHorizontallyToPosition(std::round(position));
|
||||
return StorageSumGraphController::moveCursorHorizontallyToPosition(std::round(position));
|
||||
}
|
||||
|
||||
I18n::Message TermSumController::legendMessageAtStep(Step step) {
|
||||
@@ -49,14 +48,9 @@ double TermSumController::cursorNextStep(double x, int direction) {
|
||||
return std::round(m_cursor->x()+delta);
|
||||
}
|
||||
|
||||
Layout TermSumController::createFunctionLayout(const char * functionName) {
|
||||
return HorizontalLayout::Builder(
|
||||
CodePointLayout::Builder(functionName[0], KDFont::SmallFont),
|
||||
VerticalOffsetLayout::Builder(
|
||||
CodePointLayout::Builder('n', KDFont::SmallFont),
|
||||
VerticalOffsetLayoutNode::Type::Subscript
|
||||
)
|
||||
);
|
||||
Layout TermSumController::createFunctionLayout(Shared::ExpiringPointer<Shared::StorageFunction> function) {
|
||||
Shared::ExpiringPointer<Sequence> sequence = static_cast<Shared::ExpiringPointer<Sequence>>(function);
|
||||
return sequence->nameLayout();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user