mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[solver] Delete equation at first backspace event (instead of clearing
the expression as in Graph/Sequence)
This commit is contained in:
@@ -20,6 +20,9 @@ public:
|
||||
Poincare::ExpressionLayout * layout();
|
||||
virtual bool isDefined();
|
||||
virtual bool isEmpty();
|
||||
virtual bool shouldBeClearedBeforeRemove() {
|
||||
return !isEmpty();
|
||||
}
|
||||
virtual void setContent(const char * c);
|
||||
virtual void tidy();
|
||||
private:
|
||||
|
||||
@@ -70,7 +70,7 @@ bool ExpressionModelListController::handleEventOnExpression(Ion::Events::Event e
|
||||
}
|
||||
if (event == Ion::Events::Backspace && !isAddEmptyRow(selectedRow())) {
|
||||
ExpressionModel * model = modelStore()->modelAtIndex(modelIndexForRow(selectedRow()));
|
||||
if (!model->isEmpty()) {
|
||||
if (model->shouldBeClearedBeforeRemove()) {
|
||||
reinitExpression(model);
|
||||
} else {
|
||||
if (removeModelRow(model)) {
|
||||
|
||||
@@ -15,6 +15,9 @@ public:
|
||||
Equation(Equation&& other) = delete;
|
||||
void setContent(const char * c) override;
|
||||
void tidy() override;
|
||||
bool shouldBeClearedBeforeRemove() override {
|
||||
return false;
|
||||
}
|
||||
Poincare::Expression * standardForm(Poincare::Context * context) const;
|
||||
private:
|
||||
mutable Poincare::Expression * m_standardForm;
|
||||
|
||||
Reference in New Issue
Block a user