[escher] Inline ScrollView::setCommonMargins

This commit is contained in:
Ruben Dashyan
2019-02-15 13:45:09 +01:00
committed by EmilieNumworks
parent 3d254b9ef1
commit 9ea63678e1
3 changed files with 7 additions and 9 deletions

View File

@@ -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:

View File

@@ -1,6 +1,5 @@
#include <escher/scroll_view.h>
#include <escher/palette.h>
#include <escher/metric.h>
#include <new>
@@ -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)) {

View File

@@ -1,5 +1,6 @@
#include <escher/selectable_table_view.h>
#include <escher/clipboard.h>
#include <escher/metric.h>
#include <assert.h>
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() {