[escher] Add a ScrollViewDelegate

This commit is contained in:
Romain Goyet
2018-05-09 17:14:04 +02:00
committed by LeaNumworks
parent 7851aa6fff
commit daee2998c5
3 changed files with 17 additions and 13 deletions

View File

@@ -1,19 +1,12 @@
#include <escher/scroll_view_data_source.h>
ScrollViewDataSource::ScrollViewDataSource() :
m_offset(KDPointZero)
{
}
KDPoint ScrollViewDataSource::offset() const {
return m_offset;
}
bool ScrollViewDataSource::setOffset(KDPoint offset) {
if (offset != m_offset) {
m_offset = offset;
if (m_delegate) {
m_delegate->scrollViewDidChangeOffset(this);
}
return true;
}
return false;
}