[code] Script editor and Console are stacked.

Before, they appeared in modal views.

Change-Id: I42ea742370cd3cf0854965f67fc44b43db4cc309
This commit is contained in:
Léa Saviot
2017-10-31 18:10:18 +01:00
committed by Romain Goyet
parent eadf4a018a
commit fbdf6379d8
9 changed files with 51 additions and 80 deletions

View File

@@ -1,6 +1,5 @@
#include <escher/button_row_controller.h>
#include <escher/palette.h>
#include <assert.h>
#include <cmath>
ButtonRowDelegate::ButtonRowDelegate(ButtonRowController * header, ButtonRowController * footer) :
@@ -9,23 +8,6 @@ ButtonRowDelegate::ButtonRowDelegate(ButtonRowController * header, ButtonRowCont
{
}
int ButtonRowDelegate::numberOfButtons(ButtonRowController::Position position) const {
return 0;
}
Button * ButtonRowDelegate::buttonAtIndex(int index, ButtonRowController::Position position) const {
assert(false);
return nullptr;
}
ButtonRowController * ButtonRowDelegate::footer() {
return m_footer;
}
ButtonRowController * ButtonRowDelegate::header() {
return m_header;
}
ButtonRowController::ContentView::ContentView(ViewController * mainViewController, ButtonRowDelegate * delegate, Position position, Style style) :
View(),
m_mainViewController(mainViewController),
@@ -165,28 +147,12 @@ bool ButtonRowController::ContentView::setSelectedButton(int selectedButton, App
return false;
}
int ButtonRowController::ContentView::selectedButton() {
return m_selectedButton;
}
ViewController * ButtonRowController::ContentView::mainViewController() const {
return m_mainViewController;
}
ButtonRowDelegate * ButtonRowController::ContentView::buttonRowDelegate() const {
return m_delegate;
}
ButtonRowController::ButtonRowController(Responder * parentResponder, ViewController * mainViewController, ButtonRowDelegate * delegate, Position position, Style style) :
ViewController(parentResponder),
m_contentView(mainViewController, delegate, position, style)
{
}
View * ButtonRowController::view() {
return &m_contentView;
}
const char * ButtonRowController::title() {
return m_contentView.mainViewController()->title();
}
@@ -195,6 +161,10 @@ void ButtonRowController::didBecomeFirstResponder(){
app()->setFirstResponder(m_contentView.mainViewController());
}
int ButtonRowController::selectedButton() {
return m_contentView.selectedButton();
}
bool ButtonRowController::setSelectedButton(int selectedButton) {
App * application = app();
return m_contentView.setSelectedButton(selectedButton, application);