[solver] Fix update of the button message between: 'Solve the equation'

and 'Solve the system'
This commit is contained in:
Émilie Feral
2018-06-11 11:40:25 +02:00
parent 2002cc0ff5
commit f8039fac32
3 changed files with 17 additions and 2 deletions

View File

@@ -27,6 +27,10 @@ Button * ButtonRowController::ContentView::buttonAtIndex(int index) const {
return m_delegate->buttonAtIndex(index, m_position);
}
void ButtonRowController::ContentView::reload() {
markRectAsDirty(bounds());
}
int ButtonRowController::ContentView::numberOfSubviews() const {
return numberOfButtons() + 1;
}
@@ -178,6 +182,14 @@ bool ButtonRowController::setSelectedButton(int selectedButton) {
return m_contentView.setSelectedButton(selectedButton, application);
}
void ButtonRowController::setMessageOfButtonAtIndex(I18n::Message message, int index) {
if (m_contentView.numberOfButtons() > index) {
m_contentView.buttonAtIndex(0)->setMessage(message);
m_contentView.layoutSubviews();
m_contentView.reload();
}
}
bool ButtonRowController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::Left) {
if (m_contentView.selectedButton() == 0) {