diff --git a/escher/include/escher/metric.h b/escher/include/escher/metric.h index dfaa7c8d2..aed0c6d19 100644 --- a/escher/include/escher/metric.h +++ b/escher/include/escher/metric.h @@ -7,9 +7,8 @@ class Metric { public: constexpr static KDCoordinate LeftMargin = 20; constexpr static KDCoordinate RightMargin = 20; - constexpr static KDCoordinate TopMargin = 10; - constexpr static KDCoordinate BottomMargin = 10; - constexpr static KDCoordinate LabelMargin = 5; + constexpr static KDCoordinate TopMargin = 15; + constexpr static KDCoordinate BottomMargin = 15; constexpr static KDCoordinate ParameterCellHeight = 35; }; diff --git a/escher/include/escher/scroll_view.h b/escher/include/escher/scroll_view.h index 0889e704a..b6ad08bf5 100644 --- a/escher/include/escher/scroll_view.h +++ b/escher/include/escher/scroll_view.h @@ -9,7 +9,7 @@ class ScrollView : public View { public: ScrollView(View * contentView, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0, bool showIndicators = true, - bool colorBackground = true, KDColor backgroundColor = Palette::WallScreen, KDCoordinate indicatorThickness = 10, + bool colorBackground = true, KDColor backgroundColor = Palette::WallScreen, KDCoordinate indicatorThickness = 20, KDColor indicatorColor = Palette::GreyDark, KDColor backgroundIndicatorColor = Palette::GreyMiddle, KDCoordinate indicatorMargin = 14); diff --git a/escher/include/escher/selectable_table_view.h b/escher/include/escher/selectable_table_view.h index 5201243f7..1dc5f9af1 100644 --- a/escher/include/escher/selectable_table_view.h +++ b/escher/include/escher/selectable_table_view.h @@ -20,7 +20,7 @@ public: KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0, SelectableTableViewDelegate * delegate = nullptr, bool showIndicators = true, bool colorBackground = true, KDColor backgroundColor = Palette::WallScreen, - KDCoordinate indicatorThickness = 10, KDColor indicatorColor = Palette::GreyDark, + KDCoordinate indicatorThickness = 20, KDColor indicatorColor = Palette::GreyDark, KDColor backgroundIndicatorColor = Palette::GreyMiddle, KDCoordinate indicatorMargin = 14); int selectedRow(); diff --git a/escher/include/escher/stack_view_controller.h b/escher/include/escher/stack_view_controller.h index 0d1ac4b31..3fbcc25a4 100644 --- a/escher/include/escher/stack_view_controller.h +++ b/escher/include/escher/stack_view_controller.h @@ -34,6 +34,7 @@ private: const char * className() const override; #endif private: + static constexpr KDCoordinate k_stackHeight = 20; int numberOfSubviews() const override; View * subviewAtIndex(int index) override; void layoutSubviews() override; diff --git a/escher/include/escher/tab_view.h b/escher/include/escher/tab_view.h index 801f71d3f..5bac28ca8 100644 --- a/escher/include/escher/tab_view.h +++ b/escher/include/escher/tab_view.h @@ -22,6 +22,7 @@ protected: void logAttributes(std::ostream &os) const override; #endif private: + constexpr static KDCoordinate k_activeTabWidth = 5; int numberOfSubviews() const override; View * subviewAtIndex(int index) override; void layoutSubviews() override; diff --git a/escher/include/escher/tab_view_controller.h b/escher/include/escher/tab_view_controller.h index 93f7263f5..eb4f3d5a8 100644 --- a/escher/include/escher/tab_view_controller.h +++ b/escher/include/escher/tab_view_controller.h @@ -29,6 +29,7 @@ private: const char * className() const override; #endif private: + static constexpr KDCoordinate k_tabHeight = 27; int numberOfSubviews() const override; View * subviewAtIndex(int index) override; void layoutSubviews() override; diff --git a/escher/include/escher/table_view.h b/escher/include/escher/table_view.h index 66d8c96ec..ae38753a1 100644 --- a/escher/include/escher/table_view.h +++ b/escher/include/escher/table_view.h @@ -11,7 +11,7 @@ public: TableView(TableViewDataSource * dataSource, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0, bool showIndicators = true, bool colorBackground = true, KDColor backgroundColor = Palette::WallScreen, - KDCoordinate indicatorThickness = 10, KDColor indicatorColor = Palette::GreyDark, + KDCoordinate indicatorThickness = 20, KDColor indicatorColor = Palette::GreyDark, KDColor backgroundIndicatorColor = Palette::GreyMiddle, KDCoordinate indicatorMargin = 14); virtual void scrollToCell(int i, int j); diff --git a/escher/src/metric.cpp b/escher/src/metric.cpp index 11fbb5555..732b30746 100644 --- a/escher/src/metric.cpp +++ b/escher/src/metric.cpp @@ -4,5 +4,4 @@ constexpr KDCoordinate Metric::LeftMargin; constexpr KDCoordinate Metric::RightMargin; constexpr KDCoordinate Metric::TopMargin; constexpr KDCoordinate Metric::BottomMargin; -constexpr KDCoordinate Metric::LabelMargin; constexpr KDCoordinate Metric::ParameterCellHeight; diff --git a/escher/src/stack_view_controller.cpp b/escher/src/stack_view_controller.cpp index b4dc3497b..5add39220 100644 --- a/escher/src/stack_view_controller.cpp +++ b/escher/src/stack_view_controller.cpp @@ -35,16 +35,15 @@ void StackViewController::ControllerView::popStack() { } void StackViewController::ControllerView::layoutSubviews() { - KDCoordinate stackHeight = 20; KDCoordinate width = m_frame.width(); int indexFirstHeader = m_displayFirstStackHeader ? 0 : 1; for (int i=indexFirstHeader; i 1); - KDRect contentViewFrame = KDRect( 0, (m_numberOfStacks-indexFirstHeader)*stackHeight + separatorHeight, - width, m_frame.height() - (m_numberOfStacks-indexFirstHeader)*stackHeight); + KDRect contentViewFrame = KDRect( 0, (m_numberOfStacks-indexFirstHeader)*k_stackHeight + separatorHeight, + width, m_frame.height() - (m_numberOfStacks-indexFirstHeader)*k_stackHeight); m_contentView->setFrame(contentViewFrame); } } diff --git a/escher/src/tab_view.cpp b/escher/src/tab_view.cpp index 049958ae5..f38801712 100644 --- a/escher/src/tab_view.cpp +++ b/escher/src/tab_view.cpp @@ -20,7 +20,7 @@ void TabView::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate height = bounds().height(); KDCoordinate width = bounds().width(); // Draw a separator with the content - ctx->fillRect(KDRect(0, height-5, width, 5), KDColorWhite); + ctx->fillRect(KDRect(0, height-k_activeTabWidth, width, k_activeTabWidth), KDColorWhite); } void TabView::addTabNamed(const char * name) { @@ -81,7 +81,7 @@ void TabView::layoutSubviews() { } KDRect cellFrame = KDRect( widthUsed, 0, - tabWidth, m_frame.height() - 5 + tabWidth, m_frame.height() - k_activeTabWidth ); m_cells[i].setFrame(cellFrame); widthUsed += tabWidth; diff --git a/escher/src/tab_view_controller.cpp b/escher/src/tab_view_controller.cpp index 117c3a587..cac2c7e9f 100644 --- a/escher/src/tab_view_controller.cpp +++ b/escher/src/tab_view_controller.cpp @@ -17,18 +17,16 @@ void TabViewController::ContentView::setActiveView(View * view) { } void TabViewController::ContentView::layoutSubviews() { - KDCoordinate tabHeight = 20; - KDRect tabViewFrame = KDRect( 0, 0, - m_frame.width(), tabHeight + m_frame.width(), k_tabHeight ); m_tabView.setFrame(tabViewFrame); if (m_activeView) { KDRect activeViewFrame = KDRect( - 0, tabHeight, + 0, k_tabHeight, m_frame.width(), - m_frame.height() - tabHeight + m_frame.height() - k_tabHeight ); m_activeView->setFrame(activeViewFrame); }