[solver] Reload the brace view when adding or removing row in the list

controller
This commit is contained in:
Émilie Feral
2018-06-08 10:40:11 +02:00
parent ad6c985111
commit ed74c4e6e2
2 changed files with 16 additions and 0 deletions

View File

@@ -101,6 +101,8 @@ void ListController::didBecomeFirstResponder() {
void ListController::didEnterResponderChain(Responder * previousFirstResponder) {
selectableTableView()->reloadData();
// Reload brace if the model store has evolved
reloadBrace();
}
bool textRepresentsAnEquality(const char * text) {
@@ -189,6 +191,18 @@ void ListController::addEmptyModel() {
app()->displayModalViewController(&m_modelsStackController, 0.f, 0.f, Metric::CommonTopMargin, Metric::CommonRightMargin, 0, Metric::CommonLeftMargin);
}
bool ListController::removeModelRow(ExpressionModel * model) {
ExpressionModelListController::removeModelRow(model);
reloadBrace();
return true;
}
void ListController::reloadBrace() {
EquationListView * listView = static_cast<EquationListView *>(view());
listView->displayBrace(m_equationStore->numberOfModels() > 1);
listView->layoutSubviews();
}
SelectableTableView * ListController::selectableTableView() {
return static_cast<EquationListView *>(view())->selectableTableView();
}