mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[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.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "language_controller.h"
|
||||
#include "../global_preferences.h"
|
||||
#include "../apps_container.h"
|
||||
#include <escher/scroll_view_indicator.h>
|
||||
#include <algorithm>
|
||||
|
||||
namespace OnBoarding {
|
||||
@@ -11,6 +12,9 @@ LanguageController::LanguageController(Responder * parentResponder) :
|
||||
std::max(static_cast<int>(Metric::CommonLeftMargin),
|
||||
(Ion::Display::Height - I18n::NumberOfLanguages*Metric::ParameterCellHeight)/2))
|
||||
{
|
||||
static_cast<ScrollViewIndicator * >(m_selectableTableView.decorator()->indicatorAtIndex(1))->setMargin(
|
||||
std::max(static_cast<int>(Metric::CommonLeftMargin),
|
||||
(Ion::Display::Height - I18n::NumberOfLanguages*Metric::ParameterCellHeight)/2));
|
||||
}
|
||||
|
||||
bool LanguageController::handleEvent(Ion::Events::Event event) {
|
||||
|
||||
@@ -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];
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <escher/scroll_view_indicator.h>
|
||||
#include <escher/metric.h>
|
||||
#include <escher/palette.h>
|
||||
extern "C" {
|
||||
#include <assert.h>
|
||||
@@ -8,7 +9,7 @@ extern "C" {
|
||||
ScrollViewIndicator::ScrollViewIndicator() :
|
||||
View(),
|
||||
m_color(Palette::GreyDark),
|
||||
m_margin(14)
|
||||
m_margin(Metric::CommonTopMargin)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user