mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/settings] Implement structure of settings app
Change-Id: If42dc3fcb363e3ceac0dda9f89394f2535ab09be
This commit is contained in:
52
apps/settings/main_controller.cpp
Normal file
52
apps/settings/main_controller.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
#include "main_controller.h"
|
||||
#include <assert.h>
|
||||
|
||||
namespace Settings {
|
||||
|
||||
MainController::MainController(Responder * parentResponder) :
|
||||
ViewController(parentResponder),
|
||||
m_cells{ChevronMenuListCell((char*)"Angles"), ChevronMenuListCell((char*)"Resultats"), ChevronMenuListCell((char*)"Forme nombre"),
|
||||
ChevronMenuListCell((char*)"Forme complexe"), ChevronMenuListCell((char*)"Langue")},
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::TopMargin, Metric::RightMargin,
|
||||
Metric::BottomMargin, Metric::LeftMargin))
|
||||
{
|
||||
}
|
||||
|
||||
const char * MainController::title() const {
|
||||
return "Parametres";
|
||||
}
|
||||
|
||||
View * MainController::view() {
|
||||
return &m_selectableTableView;
|
||||
}
|
||||
|
||||
void MainController::didBecomeFirstResponder() {
|
||||
if (m_selectableTableView.selectedRow() < 0) {
|
||||
m_selectableTableView.selectCellAtLocation(0, 0);
|
||||
}
|
||||
app()->setFirstResponder(&m_selectableTableView);
|
||||
}
|
||||
|
||||
bool MainController::handleEvent(Ion::Events::Event event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int MainController::numberOfRows() {
|
||||
return k_totalNumberOfCell;
|
||||
};
|
||||
|
||||
TableViewCell * MainController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCell);
|
||||
return &m_cells[index];
|
||||
}
|
||||
|
||||
int MainController::reusableCellCount() {
|
||||
return k_totalNumberOfCell;
|
||||
}
|
||||
|
||||
KDCoordinate MainController::cellHeight() {
|
||||
return Metric::ParameterCellHeight;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user