From d7231faf5c87ec1dd4f300528704108e3476e2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 29 Sep 2016 14:38:53 +0200 Subject: [PATCH] [escher] add getter for margins in scrollview Change-Id: If12d7e6aec1f801c3b667ea9b0d44b85acd7ae42 --- escher/include/escher/scroll_view.h | 2 ++ escher/src/scroll_view.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/escher/include/escher/scroll_view.h b/escher/include/escher/scroll_view.h index f55f529c8..4380d59ea 100644 --- a/escher/include/escher/scroll_view.h +++ b/escher/include/escher/scroll_view.h @@ -11,6 +11,8 @@ public: void setContentOffset(KDPoint offset); KDPoint contentOffset(); + KDCoordinate topMargin() const; + KDCoordinate leftMargin() const; void drawRect(KDContext * ctx, KDRect rect) const override; protected: KDCoordinate maxContentWidthDisplayableWithoutScrolling(); diff --git a/escher/src/scroll_view.cpp b/escher/src/scroll_view.cpp index d6dbaf954..e2c3ad93d 100644 --- a/escher/src/scroll_view.cpp +++ b/escher/src/scroll_view.cpp @@ -120,6 +120,13 @@ KDPoint ScrollView::contentOffset() { return m_offset; } +KDCoordinate ScrollView::topMargin() const { + return m_topMargin; +} + +KDCoordinate ScrollView::leftMargin() const { + return m_leftMargin; +} KDCoordinate ScrollView::maxContentWidthDisplayableWithoutScrolling() { return m_frame.width() - m_leftMargin - m_rightMargin;