diff --git a/apps/calculation/selectable_table_view.cpp b/apps/calculation/selectable_table_view.cpp index f0223de85..611337e10 100644 --- a/apps/calculation/selectable_table_view.cpp +++ b/apps/calculation/selectable_table_view.cpp @@ -4,7 +4,7 @@ namespace Calculation { CalculationSelectableTableView::CalculationSelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource, SelectableTableViewDelegate * delegate) : - ::SelectableTableView(parentResponder, dataSource, 0, 0, 0, 0, 0, delegate, false) + ::SelectableTableView(parentResponder, dataSource, 0, 0, 0, 0, 0, 0, delegate, false) { } @@ -69,4 +69,4 @@ void CalculationSelectableTableView::scrollToSubviewOfTypeOfCellAtLocation(Histo } -} \ No newline at end of file +} diff --git a/apps/graph/values/derivative_parameter_controller.cpp b/apps/graph/values/derivative_parameter_controller.cpp index 1dc4a8591..8c48d28b8 100644 --- a/apps/graph/values/derivative_parameter_controller.cpp +++ b/apps/graph/values/derivative_parameter_controller.cpp @@ -8,7 +8,7 @@ DerivativeParameterController::DerivativeParameterController(ValuesController * ViewController(valuesController), m_hideColumn(MessageTableCell(I18n::Message::HideDerivativeColumn)), m_copyColumn(MessageTableCellWithChevron(I18n::Message::CopyColumnInList)), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_function(nullptr), m_valuesController(valuesController) diff --git a/apps/home/controller.cpp b/apps/home/controller.cpp index a6282f6c6..ec2b97522 100644 --- a/apps/home/controller.cpp +++ b/apps/home/controller.cpp @@ -9,7 +9,7 @@ namespace Home { Controller::Controller(Responder * parentResponder, ::AppsContainer * container) : ViewController(parentResponder), m_container(container), - m_selectableTableView(SelectableTableView(this, this, 0, 0, k_sideMargin, 0, k_sideMargin, this, true, true, + m_selectableTableView(SelectableTableView(this, this, 0, 0, 0, k_sideMargin, 0, k_sideMargin, this, true, true, KDColorWhite, k_indicatorThickness, Palette::YellowDark, Palette::GreyMiddle, k_indicatorMargin)) { } diff --git a/apps/math_toolbox.cpp b/apps/math_toolbox.cpp index 9ae60afd7..daa3f6ec8 100644 --- a/apps/math_toolbox.cpp +++ b/apps/math_toolbox.cpp @@ -116,7 +116,7 @@ void MathToolbox::ListController::setFirstSelectedRow(int firstSelectedRow) { MathToolbox::MathToolbox() : Toolbox(nullptr, &m_listController), - m_selectableTableView(SelectableTableView(&m_listController, this, 1, 0, 0, 0, 0, nullptr, false)), + m_selectableTableView(SelectableTableView(&m_listController, this, 0, 1, 0, 0, 0, 0, nullptr, false)), m_listController(this, &m_selectableTableView), m_nodeModel(nullptr) { diff --git a/apps/probability/image_table_view.cpp b/apps/probability/image_table_view.cpp index aebe3575e..4a639feaf 100644 --- a/apps/probability/image_table_view.cpp +++ b/apps/probability/image_table_view.cpp @@ -45,7 +45,7 @@ void ImageTableView::ImageCell::setImage(const Image * image, const Image * focu ImageTableView::ImageTableView(Responder * parentResponder, Calculation * calculation, CalculationController * calculationController) : View(), Responder(parentResponder), - m_selectableTableView(SelectableTableView(this, this, 0, 0, 0, 0, 0, nullptr, false, false)), + m_selectableTableView(SelectableTableView(this, this, 0, 0, 0, 0, 0, 0, nullptr, false, false)), m_isSelected(false), m_selectedIcon(0), m_calculation(calculation), diff --git a/apps/probability/law_controller.cpp b/apps/probability/law_controller.cpp index d779e0657..f9fb76a19 100644 --- a/apps/probability/law_controller.cpp +++ b/apps/probability/law_controller.cpp @@ -53,7 +53,7 @@ static I18n::Message sMessages[] = { LawController::LawController(Responder * parentResponder) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin-ContentView::k_titleMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin-ContentView::k_titleMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_contentView(&m_selectableTableView), m_law(nullptr), diff --git a/apps/regression/initialisation_parameter_controller.cpp b/apps/regression/initialisation_parameter_controller.cpp index 78acdb2a7..39c923852 100644 --- a/apps/regression/initialisation_parameter_controller.cpp +++ b/apps/regression/initialisation_parameter_controller.cpp @@ -8,7 +8,7 @@ namespace Regression { InitialisationParameterController::InitialisationParameterController(Responder * parentResponder, Store * store) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_store(store) { diff --git a/apps/regression/prediction_parameter_controller.cpp b/apps/regression/prediction_parameter_controller.cpp index ae8c812e2..0ec5c6022 100644 --- a/apps/regression/prediction_parameter_controller.cpp +++ b/apps/regression/prediction_parameter_controller.cpp @@ -7,7 +7,7 @@ namespace Regression { PredictionParameterController::PredictionParameterController(Responder * parentResponder, Store * store, CurveViewCursor * cursor) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_goToParameterController(GoToParameterController(this, store, cursor)) { diff --git a/apps/sequence/list/type_parameter_controller.cpp b/apps/sequence/list/type_parameter_controller.cpp index bdf439564..194a472b8 100644 --- a/apps/sequence/list/type_parameter_controller.cpp +++ b/apps/sequence/list/type_parameter_controller.cpp @@ -14,7 +14,7 @@ TypeParameterController::TypeParameterController(Responder * parentResponder, Se m_expliciteCell(ExpressionTableCellWithPointer(I18n::Message::Explicite, cellLayout)), m_singleRecurrenceCell(ExpressionTableCellWithPointer(I18n::Message::SingleRecurrence, cellLayout)), m_doubleRecurenceCell(ExpressionTableCellWithPointer(I18n::Message::DoubleRecurrence, cellLayout)), - m_selectableTableView(SelectableTableView(this, this, 1, topMargin, rightMargin, bottomMargin, leftMargin, nullptr, false)), + m_selectableTableView(SelectableTableView(this, this, 0, 1, topMargin, rightMargin, bottomMargin, leftMargin, nullptr, false)), m_sequenceStore(sequenceStore), m_sequence(nullptr), m_listController(list) diff --git a/apps/settings/main_controller.cpp b/apps/settings/main_controller.cpp index b955f965b..e7fbf2ad3 100644 --- a/apps/settings/main_controller.cpp +++ b/apps/settings/main_controller.cpp @@ -23,7 +23,7 @@ MainController::MainController(Responder * parentResponder) : m_cells{MessageTableCellWithChevronAndMessage(KDText::FontSize::Large, KDText::FontSize::Small), MessageTableCellWithChevronAndMessage(KDText::FontSize::Large, KDText::FontSize::Small), MessageTableCellWithChevronAndMessage(KDText::FontSize::Large, KDText::FontSize::Small)}, m_complexFormatCell(MessageTableCellWithChevronAndExpression(I18n::Message::Default, KDText::FontSize::Large)), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_nodeModel((Node *)&model), m_subController(this) diff --git a/apps/settings/sub_controller.cpp b/apps/settings/sub_controller.cpp index 52f94a12c..a4b250a3d 100644 --- a/apps/settings/sub_controller.cpp +++ b/apps/settings/sub_controller.cpp @@ -13,7 +13,7 @@ SubController::SubController(Responder * parentResponder) : ViewController(parentResponder), m_cells{MessageTableCell(I18n::Message::Default, KDText::FontSize::Large), MessageTableCell(I18n::Message::Default, KDText::FontSize::Large), MessageTableCell(I18n::Message::Default, KDText::FontSize::Large)}, - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_nodeModel(nullptr), m_preferenceIndex(0) diff --git a/apps/shared/float_parameter_controller.cpp b/apps/shared/float_parameter_controller.cpp index 921ef1c5f..2f4eb76a1 100644 --- a/apps/shared/float_parameter_controller.cpp +++ b/apps/shared/float_parameter_controller.cpp @@ -10,7 +10,7 @@ namespace Shared { FloatParameterController::FloatParameterController(Responder * parentResponder, I18n::Message okButtonText) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin, this)), m_okButton(ButtonWithSeparator(&m_selectableTableView, okButtonText, Invocation([](void * context, void * sender) { FloatParameterController * parameterController = (FloatParameterController *) context; diff --git a/apps/shared/function_curve_parameter_controller.cpp b/apps/shared/function_curve_parameter_controller.cpp index a865ce5d7..c64b4fdc6 100644 --- a/apps/shared/function_curve_parameter_controller.cpp +++ b/apps/shared/function_curve_parameter_controller.cpp @@ -6,7 +6,7 @@ namespace Shared { FunctionCurveParameterController::FunctionCurveParameterController(InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor, I18n::Message symbol) : ViewController(nullptr), m_goToCell(MessageTableCellWithChevron(I18n::Message::Goto)), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_goToParameterController(GoToParameterController(this, graphRange, cursor, symbol)), m_function(nullptr) diff --git a/apps/shared/initialisation_parameter_controller.cpp b/apps/shared/initialisation_parameter_controller.cpp index 61924cd68..2e2f4807e 100644 --- a/apps/shared/initialisation_parameter_controller.cpp +++ b/apps/shared/initialisation_parameter_controller.cpp @@ -6,7 +6,7 @@ namespace Shared { InitialisationParameterController::InitialisationParameterController(Responder * parentResponder, InteractiveCurveViewRange * graphRange) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_graphRange(graphRange) { diff --git a/apps/shared/list_controller.cpp b/apps/shared/list_controller.cpp index 45fe5159a..7d458e2b8 100644 --- a/apps/shared/list_controller.cpp +++ b/apps/shared/list_controller.cpp @@ -6,7 +6,7 @@ namespace Shared { ListController::ListController(Responder * parentResponder, FunctionStore * functionStore, ButtonRowController * header, ButtonRowController * footer, I18n::Message text) : ViewController(parentResponder), ButtonRowDelegate(header, footer), - m_selectableTableView(SelectableTableView(this, this, 0, 0, 0, 0, 0, nullptr, false, true)), + m_selectableTableView(SelectableTableView(this, this, 0, 0, 0, 0, 0, 0, nullptr, false, true)), m_functionStore(functionStore), m_addNewFunction(text), m_plotButton(this, I18n::Message::Plot, Invocation([](void * context, void * sender) { diff --git a/apps/shared/list_parameter_controller.cpp b/apps/shared/list_parameter_controller.cpp index ef444a665..f4d61d480 100644 --- a/apps/shared/list_parameter_controller.cpp +++ b/apps/shared/list_parameter_controller.cpp @@ -5,7 +5,7 @@ namespace Shared { ListParameterController::ListParameterController(Responder * parentResponder, FunctionStore * functionStore, I18n::Message functionColorMessage, I18n::Message deleteFunctionMessage) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_functionStore(functionStore), m_colorCell(MessageTableCellWithChevron(functionColorMessage)), diff --git a/apps/shared/store_parameter_controller.cpp b/apps/shared/store_parameter_controller.cpp index 45d85af14..11dbcdf78 100644 --- a/apps/shared/store_parameter_controller.cpp +++ b/apps/shared/store_parameter_controller.cpp @@ -8,7 +8,7 @@ StoreParameterController::StoreParameterController(Responder * parentResponder, m_deleteColumn(MessageTableCell(I18n::Message::ClearColumn)), m_copyColumn(MessageTableCellWithChevron(I18n::Message::CopyColumnInList)), m_importList(MessageTableCellWithChevron(I18n::Message::ImportList)), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_store(store), m_xColumnSelected(true) diff --git a/apps/shared/tab_table_controller.cpp b/apps/shared/tab_table_controller.cpp index c983a4a2a..2a7ad77e4 100644 --- a/apps/shared/tab_table_controller.cpp +++ b/apps/shared/tab_table_controller.cpp @@ -5,7 +5,7 @@ namespace Shared { TabTableController::TabTableController(Responder * parentResponder, TableViewDataSource * dataSource, KDCoordinate topMargin, KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin, SelectableTableViewDelegate * delegate, bool showIndicators) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, dataSource, 0, topMargin, rightMargin, bottomMargin, leftMargin, + m_selectableTableView(SelectableTableView(this, dataSource, 0, 0, topMargin, rightMargin, bottomMargin, leftMargin, delegate, showIndicators, true, Palette::WallScreenDark)) { } diff --git a/apps/shared/values_function_parameter_controller.cpp b/apps/shared/values_function_parameter_controller.cpp index f3dc58dde..d74692eff 100644 --- a/apps/shared/values_function_parameter_controller.cpp +++ b/apps/shared/values_function_parameter_controller.cpp @@ -6,7 +6,7 @@ namespace Shared { ValuesFunctionParameterController::ValuesFunctionParameterController(char symbol) : ViewController(nullptr), m_copyColumn(MessageTableCellWithChevron(I18n::Message::CopyColumnInList)), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_function(nullptr), m_symbol(symbol) diff --git a/apps/shared/values_parameter_controller.cpp b/apps/shared/values_parameter_controller.cpp index 326fd9481..98ed2650a 100644 --- a/apps/shared/values_parameter_controller.cpp +++ b/apps/shared/values_parameter_controller.cpp @@ -9,7 +9,7 @@ ValuesParameterController::ValuesParameterController(Responder * parentResponder m_deleteColumn(MessageTableCell(I18n::Message::ClearColumn)), m_copyColumn(MessageTableCellWithChevron(I18n::Message::CopyColumnInList)), m_setInterval(MessageTableCellWithChevron(I18n::Message::IntervalSet)), - m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_intervalParameterController(intervalParameterController) { diff --git a/apps/variable_box_controller.cpp b/apps/variable_box_controller.cpp index 0bd971ee3..09e6040e6 100644 --- a/apps/variable_box_controller.cpp +++ b/apps/variable_box_controller.cpp @@ -12,7 +12,7 @@ VariableBoxController::ContentViewController::ContentViewController(Responder * m_firstSelectedRow(0), m_previousSelectedRow(0), m_currentPage(Page::RootMenu), - m_selectableTableView(SelectableTableView(this, this, 1, 0, 0, 0, 0, nullptr, false)) + m_selectableTableView(SelectableTableView(this, this, 0, 1, 0, 0, 0, 0, nullptr, false)) { } diff --git a/escher/include/escher/selectable_table_view.h b/escher/include/escher/selectable_table_view.h index e04cbb2a6..f1f41245e 100644 --- a/escher/include/escher/selectable_table_view.h +++ b/escher/include/escher/selectable_table_view.h @@ -16,7 +16,7 @@ class SelectableTableView : public TableView, public Responder { public: - SelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource, int cellOverlapping, + SelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource, KDCoordinate horizontalCellOverlapping, KDCoordinate verticalCellOverlapping, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0, SelectableTableViewDelegate * delegate = nullptr, bool showIndicators = true, bool colorBackground = true, KDColor backgroundColor = Palette::WallScreen, diff --git a/escher/include/escher/table_view.h b/escher/include/escher/table_view.h index 8dfe98d51..68a530e7f 100644 --- a/escher/include/escher/table_view.h +++ b/escher/include/escher/table_view.h @@ -8,7 +8,7 @@ class TableView : public ScrollView { public: - TableView(TableViewDataSource * dataSource, int cellOverlapping, KDCoordinate topMargin = 0, + TableView(TableViewDataSource * dataSource, KDCoordinate horizontalCellOverlapping, KDCoordinate verticalCellOverlapping, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0, bool showIndicators = true, bool colorBackground = true, KDColor backgroundColor = Palette::WallScreen, KDCoordinate indicatorThickness = 20, KDColor indicatorColor = Palette::GreyDark, @@ -25,7 +25,7 @@ protected: TableViewDataSource * dataSource(); class ContentView : public View { public: - ContentView(TableView * tableView, TableViewDataSource * dataSource, int cellOverlapping); + ContentView(TableView * tableView, TableViewDataSource * dataSource, KDCoordinate horizontalCellOverlapping, KDCoordinate verticalCellOverlapping); void scrollToCell(int i, int j) const; HighlightCell * cellAtLocation(int i, int j); @@ -67,7 +67,8 @@ protected: int typeIndexFromSubviewIndex(int index, int type) const; TableView * m_tableView; TableViewDataSource * m_dataSource; - int m_cellOverlapping; + KDCoordinate m_horizontalCellOverlapping; + KDCoordinate m_verticalCellOverlapping; }; ContentView m_contentView; private: diff --git a/escher/src/selectable_table_view.cpp b/escher/src/selectable_table_view.cpp index 2f1fd44f8..4af47d8dd 100644 --- a/escher/src/selectable_table_view.cpp +++ b/escher/src/selectable_table_view.cpp @@ -1,10 +1,9 @@ #include -SelectableTableView::SelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource, int cellOverlapping, - KDCoordinate topMargin, KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin, +SelectableTableView::SelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource, KDCoordinate horizontalCellOverlapping, KDCoordinate verticalCellOverlapping, KDCoordinate topMargin, KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin, SelectableTableViewDelegate * delegate, bool showIndicators, bool colorBackground, KDColor backgroundColor, KDCoordinate indicatorThickness, KDColor indicatorColor, KDColor backgroundIndicatorColor, KDCoordinate indicatorMargin) : - TableView(dataSource, cellOverlapping, topMargin, rightMargin, bottomMargin, leftMargin, showIndicators, colorBackground, backgroundColor, + TableView(dataSource, horizontalCellOverlapping, verticalCellOverlapping, topMargin, rightMargin, bottomMargin, leftMargin, showIndicators, colorBackground, backgroundColor, indicatorThickness, indicatorColor, backgroundIndicatorColor, indicatorMargin), Responder(parentResponder), m_delegate(delegate), diff --git a/escher/src/table_view.cpp b/escher/src/table_view.cpp index 747a9dc36..718053b9f 100644 --- a/escher/src/table_view.cpp +++ b/escher/src/table_view.cpp @@ -7,13 +7,13 @@ extern "C" { #define MIN(x,y) ((x)<(y) ? (x) : (y)) -TableView::TableView(TableViewDataSource * dataSource, int cellOverlapping, KDCoordinate topMargin, KDCoordinate rightMargin, +TableView::TableView(TableViewDataSource * dataSource, KDCoordinate horizontalCellOverlapping, KDCoordinate verticalCellOverlapping, KDCoordinate topMargin, KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin, bool showIndicators, bool colorBackground, KDColor backgroundColor, KDCoordinate indicatorThickness, KDColor indicatorColor, KDColor backgroundIndicatorColor, KDCoordinate indicatorMargin) : ScrollView(&m_contentView, topMargin, rightMargin, bottomMargin, leftMargin, showIndicators, colorBackground, backgroundColor, indicatorThickness, indicatorColor, backgroundIndicatorColor, indicatorMargin), - m_contentView(TableView::ContentView(this, dataSource, cellOverlapping)) + m_contentView(TableView::ContentView(this, dataSource, horizontalCellOverlapping, verticalCellOverlapping)) { } @@ -56,11 +56,12 @@ void TableView::reloadData() { /* TableView::ContentView */ -TableView::ContentView::ContentView(TableView * tableView, TableViewDataSource * dataSource, int cellOverlapping) : +TableView::ContentView::ContentView(TableView * tableView, TableViewDataSource * dataSource, KDCoordinate horizontalCellOverlapping, KDCoordinate verticalCellOverlapping) : View(), m_tableView(tableView), m_dataSource(dataSource), - m_cellOverlapping(cellOverlapping) + m_horizontalCellOverlapping(horizontalCellOverlapping), + m_verticalCellOverlapping(verticalCellOverlapping) { } @@ -84,11 +85,11 @@ void TableView::ContentView::resizeToFitContent() { } KDCoordinate TableView::ContentView::height() const { - return m_dataSource->cumulatedHeightFromIndex(m_dataSource->numberOfRows())+m_cellOverlapping; + return m_dataSource->cumulatedHeightFromIndex(m_dataSource->numberOfRows())+m_verticalCellOverlapping; } KDCoordinate TableView::ContentView::width() const { - int result = m_dataSource->cumulatedWidthFromIndex(m_dataSource->numberOfColumns()); + int result = m_dataSource->cumulatedWidthFromIndex(m_dataSource->numberOfColumns()+m_horizontalCellOverlapping); // handle the case of list: cumulatedWidthFromIndex() = 0 return result ? result : m_tableView->maxContentWidthDisplayableWithoutScrolling(); } @@ -101,14 +102,14 @@ void TableView::ContentView::scrollToCell(int x, int y) const { contentOffsetX = m_dataSource->cumulatedWidthFromIndex(x); } else if (columnAtIndexIsAfterFullyVisibleRange(x)) { // Let's scroll the tableView to put that cell on the right (while keeping the right margin) - contentOffsetX = m_dataSource->cumulatedWidthFromIndex(x+1)-m_tableView->maxContentWidthDisplayableWithoutScrolling(); + contentOffsetX = m_dataSource->cumulatedWidthFromIndex(x+1)+2*m_horizontalCellOverlapping - m_tableView->maxContentWidthDisplayableWithoutScrolling(); } if (rowAtIndexIsBeforeFullyVisibleRange(y)) { // Let's scroll the tableView to put that cell on the top (while keeping the top margin) contentOffsetY = m_dataSource->cumulatedHeightFromIndex(y); } else if (rowAtIndexIsAfterFullyVisibleRange(y)) { // Let's scroll the tableView to put that cell on the bottom (while keeping the bottom margin) - contentOffsetY = m_dataSource->cumulatedHeightFromIndex(y+1)+2*m_cellOverlapping - m_tableView->maxContentHeightDisplayableWithoutScrolling(); + contentOffsetY = m_dataSource->cumulatedHeightFromIndex(y+1)+2*m_verticalCellOverlapping - m_tableView->maxContentHeightDisplayableWithoutScrolling(); } m_tableView->setContentOffset(KDPoint(contentOffsetX, contentOffsetY)); } @@ -184,7 +185,7 @@ void TableView::ContentView::layoutSubviews() { KDCoordinate verticalOffset = m_dataSource->cumulatedHeightFromIndex(j); KDCoordinate horizontalOffset = m_dataSource->cumulatedWidthFromIndex(i); KDRect cellFrame(horizontalOffset, verticalOffset, - columnWidth, rowHeight+m_cellOverlapping); + columnWidth+m_horizontalCellOverlapping, rowHeight+m_verticalCellOverlapping); cell->setFrame(cellFrame);