From 5f26ca40cc33a9fbb11e811d8b1be13a358d58e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Mon, 11 May 2020 15:58:48 +0200 Subject: [PATCH] [apps/escher] Fix scroll view indicator margin So it does not overflow the scrolled view. Fixed for the language controllers (on boarding app and settings), one value was changed from a magic 14 to Metric::CommonTopMargin = 15, it did not seem to break anything. --- apps/on_boarding/language_controller.cpp | 4 ++++ apps/shared/language_controller.h | 5 ++++- escher/src/scroll_view_indicator.cpp | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/on_boarding/language_controller.cpp b/apps/on_boarding/language_controller.cpp index f65fce0cd..d4a3ae679 100644 --- a/apps/on_boarding/language_controller.cpp +++ b/apps/on_boarding/language_controller.cpp @@ -1,6 +1,7 @@ #include "language_controller.h" #include "../global_preferences.h" #include "../apps_container.h" +#include #include namespace OnBoarding { @@ -11,6 +12,9 @@ LanguageController::LanguageController(Responder * parentResponder) : std::max(static_cast(Metric::CommonLeftMargin), (Ion::Display::Height - I18n::NumberOfLanguages*Metric::ParameterCellHeight)/2)) { + static_cast(m_selectableTableView.decorator()->indicatorAtIndex(1))->setMargin( + std::max(static_cast(Metric::CommonLeftMargin), + (Ion::Display::Height - I18n::NumberOfLanguages*Metric::ParameterCellHeight)/2)); } bool LanguageController::handleEvent(Ion::Events::Event event) { diff --git a/apps/shared/language_controller.h b/apps/shared/language_controller.h index 6658ca550..a3ab284e2 100644 --- a/apps/shared/language_controller.h +++ b/apps/shared/language_controller.h @@ -23,8 +23,11 @@ public: int reusableCellCount() const override; void willDisplayCellForIndex(HighlightCell * cell, int index) override; -private: + +protected: SelectableTableView m_selectableTableView; + +private: MessageTableCell m_cells[I18n::NumberOfLanguages]; }; diff --git a/escher/src/scroll_view_indicator.cpp b/escher/src/scroll_view_indicator.cpp index be36a152b..536e54d33 100644 --- a/escher/src/scroll_view_indicator.cpp +++ b/escher/src/scroll_view_indicator.cpp @@ -1,4 +1,5 @@ #include +#include #include extern "C" { #include @@ -8,7 +9,7 @@ extern "C" { ScrollViewIndicator::ScrollViewIndicator() : View(), m_color(Palette::GreyDark), - m_margin(14) + m_margin(Metric::CommonTopMargin) { }