mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher] Add method to get data source in table view
Change-Id: I511bbbfa7727216bcd1d02b9df93491061f6a9a8
This commit is contained in:
@@ -17,6 +17,7 @@ protected:
|
||||
#if ESCHER_VIEW_LOGGING
|
||||
const char * className() const override;
|
||||
#endif
|
||||
TableViewDataSource * dataSource();
|
||||
private:
|
||||
class ContentView : public View {
|
||||
public:
|
||||
@@ -25,6 +26,7 @@ private:
|
||||
void scrollToCell(int i, int j) const;
|
||||
TableViewCell * cellAtLocation(int i, int j);
|
||||
void resizeToFitContent();
|
||||
TableViewDataSource * dataSource();
|
||||
protected:
|
||||
#if ESCHER_VIEW_LOGGING
|
||||
const char * className() const override;
|
||||
|
||||
@@ -14,6 +14,10 @@ TableView::TableView(TableViewDataSource * dataSource, KDCoordinate topMargin, K
|
||||
{
|
||||
}
|
||||
|
||||
TableViewDataSource * TableView::dataSource() {
|
||||
return m_contentView.dataSource();
|
||||
}
|
||||
|
||||
// This method computes the minimal scrolling needed to properly display the
|
||||
// requested cell.
|
||||
void TableView::scrollToCell(int i, int j) {
|
||||
@@ -52,6 +56,10 @@ TableView::ContentView::ContentView(TableView * tableView, TableViewDataSource *
|
||||
{
|
||||
}
|
||||
|
||||
TableViewDataSource * TableView::ContentView::dataSource() {
|
||||
return m_dataSource;
|
||||
}
|
||||
|
||||
KDCoordinate TableView::ContentView::columnWidth(int i) const {
|
||||
int columnWidth = m_dataSource->columnWidth(i);
|
||||
columnWidth = columnWidth ? columnWidth : m_tableView->maxContentWidthDisplayableWithoutScrolling();
|
||||
|
||||
Reference in New Issue
Block a user