From 9ea63678e16fc2b2423b09bf240da07352aa8ced Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Fri, 15 Feb 2019 13:45:09 +0100 Subject: [PATCH] [escher] Inline ScrollView::setCommonMargins --- escher/include/escher/scroll_view.h | 1 - escher/src/scroll_view.cpp | 7 ------- escher/src/selectable_table_view.cpp | 8 +++++++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/escher/include/escher/scroll_view.h b/escher/include/escher/scroll_view.h index 78cc1c70d..90555ff67 100644 --- a/escher/include/escher/scroll_view.h +++ b/escher/include/escher/scroll_view.h @@ -24,7 +24,6 @@ public: setTopMargin(top); setRightMargin(right); setBottomMargin(bottom); setLeftMargin(left); } void setMargins(KDCoordinate m) { setMargins(m, m, m, m); } - void setCommonMargins(); class Decorator { public: diff --git a/escher/src/scroll_view.cpp b/escher/src/scroll_view.cpp index 681273fdc..75d07ec11 100644 --- a/escher/src/scroll_view.cpp +++ b/escher/src/scroll_view.cpp @@ -1,6 +1,5 @@ #include #include -#include #include @@ -45,12 +44,6 @@ KDSize ScrollView::minimalSizeForOptimalDisplay() const { ); } -void ScrollView::setCommonMargins() { - setTopMargin(Metric::CommonTopMargin); - setRightMargin(Metric::CommonRightMargin); - setBottomMargin(Metric::CommonBottomMargin); - setLeftMargin(Metric::CommonLeftMargin); -} void ScrollView::scrollToContentPoint(KDPoint p, bool allowOverscroll) { if (!allowOverscroll && !m_contentView->bounds().contains(p)) { diff --git a/escher/src/selectable_table_view.cpp b/escher/src/selectable_table_view.cpp index 05c003d3b..9924a9cd7 100644 --- a/escher/src/selectable_table_view.cpp +++ b/escher/src/selectable_table_view.cpp @@ -1,5 +1,6 @@ #include #include +#include #include SelectableTableView::SelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource, SelectableTableViewDataSource * selectionDataSource, SelectableTableViewDelegate * delegate) : @@ -8,8 +9,13 @@ SelectableTableView::SelectableTableView(Responder * parentResponder, TableViewD m_selectionDataSource(selectionDataSource), m_delegate(delegate) { - setCommonMargins(); assert(m_selectionDataSource != nullptr); + setMargins( + Metric::CommonTopMargin, + Metric::CommonRightMargin, + Metric::CommonBottomMargin, + Metric::CommonLeftMargin + ); } int SelectableTableView::selectedRow() {