#include "list_controller.h" #include "app.h" #include using namespace Shared; namespace Solver { ListController::ListController(Responder * parentResponder, EquationStore * equationStore, ButtonRowController * footer) : ExpressionModelListController(parentResponder, I18n::Message::AddEquation), ButtonRowDelegate(nullptr, footer), m_equationStore(equationStore), m_resolveButton(this, equationStore->numberOfDefinedModels() > 1 ? I18n::Message::ResolveSystem : I18n::Message::ResolveEquation, Invocation([](void * context, void * sender) { ListController * list = (ListController *)context; list->resolveEquations(); }, this), KDText::FontSize::Large, Palette::PurpleBright), m_modelsParameterController(this, equationStore, this), m_modelsStackController(nullptr, &m_modelsParameterController, KDColorWhite, Palette::PurpleDark, Palette::PurpleDark) { } int ListController::numberOfButtons(ButtonRowController::Position position) const { if (position == ButtonRowController::Position::Bottom) { return 1; } return 0; } Button * ListController::buttonAtIndex(int index, ButtonRowController::Position position) const { if (position == ButtonRowController::Position::Top) { return nullptr; } return const_cast