mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] Change scroll indicator margin in table view
Change-Id: Ib3e3a5c673e39bd8d6f8515ae52f3fdfd58de300
This commit is contained in:
@@ -12,7 +12,7 @@ using namespace Shared;
|
||||
namespace Regression {
|
||||
|
||||
CalculationController::CalculationController(Responder * parentResponder, ButtonRowController * header, Store * store) :
|
||||
TabTableController(parentResponder, this, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin, true),
|
||||
TabTableController(parentResponder, this),
|
||||
ButtonRowDelegate(header, nullptr),
|
||||
m_titleCells{},
|
||||
m_r2TitleCell(nullptr),
|
||||
|
||||
@@ -8,9 +8,8 @@ using namespace Poincare;
|
||||
|
||||
namespace Shared {
|
||||
|
||||
EditableCellTableViewController::EditableCellTableViewController(Responder * parentResponder, KDCoordinate topMargin,
|
||||
KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin) :
|
||||
TabTableController(parentResponder, this, topMargin, rightMargin, bottomMargin, leftMargin, true)
|
||||
EditableCellTableViewController::EditableCellTableViewController(Responder * parentResponder) :
|
||||
TabTableController(parentResponder, this)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,7 @@ namespace Shared {
|
||||
|
||||
class EditableCellTableViewController : public TabTableController , public RegularTableViewDataSource , public TextFieldDelegate {
|
||||
public:
|
||||
EditableCellTableViewController(Responder * parentResponder, KDCoordinate topMargin,
|
||||
KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin);
|
||||
EditableCellTableViewController(Responder * parentResponder);
|
||||
bool textFieldShouldFinishEditing(TextField * textField, Ion::Events::Event event) override;
|
||||
bool textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) override;
|
||||
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
|
||||
|
||||
@@ -8,7 +8,7 @@ using namespace Poincare;
|
||||
namespace Shared {
|
||||
|
||||
StoreController::StoreController(Responder * parentResponder, FloatPairStore * store, ButtonRowController * header) :
|
||||
EditableCellTableViewController(parentResponder, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin),
|
||||
EditableCellTableViewController(parentResponder),
|
||||
ButtonRowDelegate(header, nullptr),
|
||||
m_editableCells{},
|
||||
m_store(store),
|
||||
|
||||
@@ -2,15 +2,9 @@
|
||||
|
||||
namespace Shared {
|
||||
|
||||
TabTableController::TabTableController(Responder * parentResponder, TableViewDataSource * dataSource, KDCoordinate topMargin,
|
||||
KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin, bool showIndicators) :
|
||||
TabTableController::TabTableController(Responder * parentResponder, TableViewDataSource * dataSource) :
|
||||
DynamicViewController(parentResponder),
|
||||
m_dataSource(dataSource),
|
||||
m_topMargin(topMargin),
|
||||
m_rightMargin(rightMargin),
|
||||
m_bottomMargin(bottomMargin),
|
||||
m_leftMargin(leftMargin),
|
||||
m_showIndicators(showIndicators)
|
||||
m_dataSource(dataSource)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -35,7 +29,7 @@ SelectableTableView * TabTableController::selectableTableView() {
|
||||
}
|
||||
|
||||
View * TabTableController::loadView() {
|
||||
return new SelectableTableView(this, m_dataSource, 0, 0, m_topMargin, m_rightMargin, m_bottomMargin, m_leftMargin, this, m_showIndicators, true, Palette::WallScreenDark);
|
||||
return new SelectableTableView(this, m_dataSource, 0, 0, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin, this, true, true);
|
||||
}
|
||||
|
||||
void TabTableController::unloadView(View * view) {
|
||||
|
||||
@@ -10,23 +10,17 @@ namespace Shared {
|
||||
|
||||
class TabTableController : public DynamicViewController, public SelectableTableViewDelegate {
|
||||
public:
|
||||
TabTableController(Responder * parentResponder, TableViewDataSource * dataSource, KDCoordinate topMargin,
|
||||
KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin, bool showIndicators);
|
||||
TabTableController(Responder * parentResponder, TableViewDataSource * dataSource);
|
||||
void didBecomeFirstResponder() override;
|
||||
void viewWillAppear() override;
|
||||
void willExitResponderChain(Responder * nextFirstResponder) override;
|
||||
protected:
|
||||
SelectableTableView * selectableTableView();
|
||||
View * loadView() override;
|
||||
virtual View * loadView() override;
|
||||
void unloadView(View * view) override;
|
||||
virtual Responder * tabController() const = 0;
|
||||
private:
|
||||
TableViewDataSource * m_dataSource;
|
||||
KDCoordinate m_topMargin;
|
||||
KDCoordinate m_rightMargin;
|
||||
KDCoordinate m_bottomMargin;
|
||||
KDCoordinate m_leftMargin;
|
||||
bool m_showIndicators;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ using namespace Poincare;
|
||||
namespace Shared {
|
||||
|
||||
ValuesController::ValuesController(Responder * parentResponder, ButtonRowController * header, I18n::Message parameterTitle, IntervalParameterController * intervalParameterController) :
|
||||
EditableCellTableViewController(parentResponder, k_topMargin, k_rightMargin, k_bottomMargin, k_leftMargin),
|
||||
EditableCellTableViewController(parentResponder),
|
||||
ButtonRowDelegate(header, nullptr),
|
||||
m_abscissaTitleCell(nullptr),
|
||||
m_abscissaCells{},
|
||||
@@ -296,7 +296,7 @@ float ValuesController::evaluationOfAbscissaAtColumn(float abscissa, int columnI
|
||||
}
|
||||
|
||||
View * ValuesController::loadView() {
|
||||
SelectableTableView * tableView = (SelectableTableView*)EditableCellTableViewController::loadView();
|
||||
SelectableTableView * tableView = new SelectableTableView(this, this, 0, 0, k_topMargin, k_rightMargin, k_bottomMargin, k_leftMargin, this, true, true, Palette::WallScreenDark, 13, Palette::GreyDark, Palette::GreyMiddle);
|
||||
m_abscissaTitleCell = new EvenOddMessageTextCell(KDText::FontSize::Small);
|
||||
for (int i = 0; i < k_maxNumberOfAbscissaCells; i++) {
|
||||
m_abscissaCells[i] = new EvenOddEditableTextCell(tableView, this, m_draftTextBuffer, KDText::FontSize::Small);
|
||||
|
||||
@@ -35,9 +35,9 @@ public:
|
||||
Responder * defaultController() override;
|
||||
void viewWillAppear() override;
|
||||
static constexpr KDCoordinate k_topMargin = 10;
|
||||
static constexpr KDCoordinate k_bottomMargin = 5;
|
||||
static constexpr KDCoordinate k_bottomMargin = 15;
|
||||
static constexpr KDCoordinate k_leftMargin = 1;
|
||||
static constexpr KDCoordinate k_rightMargin = 10;
|
||||
static constexpr KDCoordinate k_rightMargin = 15;
|
||||
static constexpr KDCoordinate k_abscissaCellWidth = 150;
|
||||
static constexpr KDCoordinate k_ordinateCellWidth = 100;
|
||||
protected:
|
||||
|
||||
@@ -11,7 +11,7 @@ using namespace Poincare;
|
||||
namespace Statistics {
|
||||
|
||||
CalculationController::CalculationController(Responder * parentResponder, ButtonRowController * header, Store * store) :
|
||||
TabTableController(parentResponder, this, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin, true),
|
||||
TabTableController(parentResponder, this),
|
||||
ButtonRowDelegate(header, nullptr),
|
||||
m_titleCells{},
|
||||
m_calculationCells{},
|
||||
|
||||
Reference in New Issue
Block a user