From 0d47a193b296fd28d93ac598dfa51db39180c709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Mon, 28 May 2018 14:23:59 +0200 Subject: [PATCH] [apps/stats] Fix table margins. --- apps/shared/store_controller.cpp | 2 +- apps/shared/store_controller.h | 1 + apps/statistics/calculation_controller.cpp | 4 +++- apps/statistics/calculation_controller.h | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/shared/store_controller.cpp b/apps/shared/store_controller.cpp index a0e6a5ef2..09645831c 100644 --- a/apps/shared/store_controller.cpp +++ b/apps/shared/store_controller.cpp @@ -180,7 +180,7 @@ View * StoreController::loadView() { for (int i = 0; i < k_maxNumberOfEditableCells; i++) { m_editableCells[i] = new StoreCell(tableView, this, m_draftTextBuffer); } - tableView->setMargins(k_margin); + tableView->setMargins(k_margin, k_scrollBarMargin, k_scrollBarMargin, k_margin); return tableView; } diff --git a/apps/shared/store_controller.h b/apps/shared/store_controller.h index 7ae903b9a..d6d7342ef 100644 --- a/apps/shared/store_controller.h +++ b/apps/shared/store_controller.h @@ -36,6 +36,7 @@ public: protected: static constexpr KDCoordinate k_cellWidth = 80; //TODO static constexpr KDCoordinate k_margin = 8; + static constexpr KDCoordinate k_scrollBarMargin = Metric::CommonRightMargin; constexpr static int k_maxNumberOfEditableCells = 22 * FloatPairStore::k_numberOfSeries; constexpr static int k_numberOfTitleCells = FloatPairStore::k_numberOfColumnsPerSeries * FloatPairStore::k_numberOfSeries; // TODO Put finer number of cells static constexpr int k_titleCellType = 0; diff --git a/apps/statistics/calculation_controller.cpp b/apps/statistics/calculation_controller.cpp index ddf3cf922..9fa60eb53 100644 --- a/apps/statistics/calculation_controller.cpp +++ b/apps/statistics/calculation_controller.cpp @@ -212,7 +212,9 @@ View * CalculationController::loadView() { } m_hideableCell = new HideableEvenOddCell(); m_hideableCell->setHide(true); - View * result = TabTableController::loadView(); + View * result = TabTableController::loadView(); + SelectableTableView * casterResult = static_cast(result); + casterResult->setMargins(k_margin, k_scrollBarMargin, k_scrollBarMargin, k_margin); return result; } diff --git a/apps/statistics/calculation_controller.h b/apps/statistics/calculation_controller.h index 4ade377be..fe012d30a 100644 --- a/apps/statistics/calculation_controller.h +++ b/apps/statistics/calculation_controller.h @@ -54,6 +54,8 @@ private: static constexpr KDCoordinate k_cellHeight = 20; static constexpr KDCoordinate k_calculationTitleCellWidth = 175; static constexpr KDCoordinate k_calculationCellWidth = 50; + static constexpr KDCoordinate k_margin = 8; + static constexpr KDCoordinate k_scrollBarMargin = Metric::CommonRightMargin; Responder * tabController() const override; View * loadView() override;