mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[apps/calculation] Create a specific table view for calculation which
aligns to the bottom Change-Id: I4fe9763b1d9ae2ae3e898046221b780c51515830
This commit is contained in:
26
apps/calculation/selectable_table_view.cpp
Normal file
26
apps/calculation/selectable_table_view.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "selectable_table_view.h"
|
||||
|
||||
namespace Calculation {
|
||||
|
||||
CalculationSelectableTableView::CalculationSelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource,
|
||||
SelectableTableViewDelegate * delegate) :
|
||||
::SelectableTableView(parentResponder, dataSource, 0, 0, 0, 0, delegate)
|
||||
{
|
||||
}
|
||||
|
||||
void CalculationSelectableTableView::scrollToCell(int i, int j) {
|
||||
::SelectableTableView::scrollToCell(i, j);
|
||||
if (m_contentView.bounds().height() < bounds().height()) {
|
||||
m_topMargin = bounds().height() - m_contentView.bounds().height();
|
||||
} else {
|
||||
m_topMargin = 0;
|
||||
}
|
||||
ScrollView::layoutSubviews();
|
||||
if (m_contentView.bounds().height() - contentOffset().y() < bounds().height()) {
|
||||
KDCoordinate contentOffsetX = contentOffset().x();
|
||||
KDCoordinate contentOffsetY = dataSource()->cumulatedHeightFromIndex(dataSource()->numberOfRows()) - maxContentHeightDisplayableWithoutScrolling();
|
||||
setContentOffset(KDPoint(contentOffsetX, contentOffsetY));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user