diff --git a/apps/calculation/selectable_table_view.cpp b/apps/calculation/selectable_table_view.cpp index d013d4fc7..f0223de85 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, delegate, false) + ::SelectableTableView(parentResponder, dataSource, 0, 0, 0, 0, 0, delegate, false) { } diff --git a/apps/graph/values/derivative_parameter_controller.cpp b/apps/graph/values/derivative_parameter_controller.cpp index 153f66718..a2e223cd1 100644 --- a/apps/graph/values/derivative_parameter_controller.cpp +++ b/apps/graph/values/derivative_parameter_controller.cpp @@ -9,7 +9,7 @@ DerivativeParameterController::DerivativeParameterController(ValuesController * m_pageTitle{"Colonne f'(x)"}, m_hideColumn(PointerTableCell((char*)"Masquer la colonne de la derivee")), m_copyColumn(PointerTableCellWithChevron((char*)"Copier la colonne dans une liste")), - m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 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 30ac9caaf..6b5fd7840 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, k_sideMargin, 0, k_sideMargin, this, true, true, + m_selectableTableView(SelectableTableView(this, this, 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 fc33c6b6b..c2177b6b5 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, 0, 0, 0, 0, nullptr, false)), + m_selectableTableView(SelectableTableView(&m_listController, this, 1, 0, 0, 0, 0, nullptr, false)), m_listController(this, &m_selectableTableView), m_nodeModel(nullptr) { diff --git a/apps/probability/cell.cpp b/apps/probability/cell.cpp index 4e8dd0f55..63afdb65d 100644 --- a/apps/probability/cell.cpp +++ b/apps/probability/cell.cpp @@ -60,6 +60,7 @@ void Cell::drawRect(KDContext * ctx, KDRect rect) const { ctx->fillRect(KDRect(0, 0, width, 1), Palette::GreyBright); ctx->fillRect(KDRect(0, 1, 1, height-1), Palette::GreyBright); ctx->fillRect(KDRect(width-1, 1, 1, height-1), Palette::GreyBright); + ctx->fillRect(KDRect(0, height-1, width, 1), Palette::GreyBright); } } diff --git a/apps/probability/image_table_view.cpp b/apps/probability/image_table_view.cpp index d8e16aad3..aebe3575e 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, nullptr, false, false)), + m_selectableTableView(SelectableTableView(this, this, 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 7f116d16d..17aaa30b3 100644 --- a/apps/probability/law_controller.cpp +++ b/apps/probability/law_controller.cpp @@ -53,7 +53,7 @@ static const char * sMessages[] = { LawController::LawController(Responder * parentResponder) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin-ContentView::k_titleMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 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 bd10c7bd9..e6722b852 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, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 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 4117da1ec..19ccaa597 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, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 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 050f7a2c9..c6cfcadbc 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((char*)"Explicite", cellLayout)), m_singleRecurrenceCell(ExpressionTableCellWithPointer((char*)"Recurrence d'ordre 1", cellLayout)), m_doubleRecurenceCell(ExpressionTableCellWithPointer((char*)"Recurrence d'ordre 2", cellLayout)), - m_selectableTableView(SelectableTableView(this, this, topMargin, rightMargin, bottomMargin, leftMargin)), + m_selectableTableView(SelectableTableView(this, this, 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 f66f9e9b4..17338ca10 100644 --- a/apps/settings/main_controller.cpp +++ b/apps/settings/main_controller.cpp @@ -23,7 +23,7 @@ MainController::MainController(Responder * parentResponder) : m_cells{PointerTableCellWithChevronAndPointer(KDText::FontSize::Large, KDText::FontSize::Small), PointerTableCellWithChevronAndPointer(KDText::FontSize::Large, KDText::FontSize::Small), PointerTableCellWithChevronAndPointer(KDText::FontSize::Large, KDText::FontSize::Small)}, m_complexFormatCell(PointerTableCellWithChevronAndExpression(nullptr, KDText::FontSize::Large)), - m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 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 5ca8a27fe..aba16af00 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{PointerTableCell(nullptr, KDText::FontSize::Large), PointerTableCell(nullptr, KDText::FontSize::Large), PointerTableCell(nullptr, KDText::FontSize::Large)}, - m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_nodeModel(nullptr), m_preferenceIndex(0) diff --git a/apps/shared/button_with_separator.cpp b/apps/shared/button_with_separator.cpp index c26682f41..226983a36 100644 --- a/apps/shared/button_with_separator.cpp +++ b/apps/shared/button_with_separator.cpp @@ -8,8 +8,8 @@ ButtonWithSeparator::ButtonWithSeparator(Responder * parentResponder, const char void ButtonWithSeparator::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); - - ctx->fillRect(KDRect(0, 0, width, k_margin), Palette::WallScreen); + ctx->fillRect(KDRect(0, 0, width, k_lineThickness), Palette::GreyBright); + ctx->fillRect(KDRect(0, k_lineThickness, width, k_margin-k_lineThickness), Palette::WallScreen); // Draw rectangle around cell ctx->fillRect(KDRect(0, k_margin, width, k_lineThickness), Palette::GreyBright); ctx->fillRect(KDRect(0, k_margin+k_lineThickness, k_lineThickness, height-k_margin), Palette::GreyBright); diff --git a/apps/shared/float_parameter_controller.cpp b/apps/shared/float_parameter_controller.cpp index 69afc8315..d81bcf5d3 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, const char * okButtonText) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 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 1ad9248a1..902114e3c 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, const char * symbol) : ViewController(nullptr), m_goToCell(PointerTableCellWithChevron((char*)"Aller a")), - m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 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 afdb5a1e6..95f0fa8c5 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, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 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 891b822a5..6d1b74da9 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, const char * text) : ViewController(parentResponder), ButtonRowDelegate(header, footer), - m_selectableTableView(SelectableTableView(this, this, 0, 0, 0, 0, nullptr, false, true)), + m_selectableTableView(SelectableTableView(this, this, 0, 0, 0, 0, 0, nullptr, false, true)), m_functionStore(functionStore), m_addNewFunction(text), m_plotButton(this, "Tracer la fonction", Invocation([](void * context, void * sender) { diff --git a/apps/shared/list_parameter_controller.cpp b/apps/shared/list_parameter_controller.cpp index 11997222d..c12824e83 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) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_functionStore(functionStore), m_colorCell(PointerTableCellWithChevron((char*)"Couleur de la fonction")), diff --git a/apps/shared/store_parameter_controller.cpp b/apps/shared/store_parameter_controller.cpp index 776357538..9ea48e42f 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(PointerTableCell((char*)"Effacer la colonne")), m_copyColumn(PointerTableCellWithChevron((char*)"Copier la colonne dans une liste")), m_importList(PointerTableCellWithChevron((char*)"Importer une liste")), - m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 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 20632a3b1..3c6ff7233 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, KDCoordinate topMargin, KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin, SelectableTableViewDelegate * delegate, bool showIndicators) : ViewController(parentResponder), - m_selectableTableView(SelectableTableView(this, this, topMargin, rightMargin, bottomMargin, leftMargin, + m_selectableTableView(SelectableTableView(this, this, 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 a3c8290c5..f20625f6d 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(PointerTableCellWithChevron((char*)"Copier la colonne dans une liste")), - m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 1, Metric::CommonTopMargin, Metric::CommonRightMargin, Metric::CommonBottomMargin, Metric::CommonLeftMargin)), m_pageTitle{"Colonne f(x)"}, m_function(nullptr) diff --git a/apps/shared/values_parameter_controller.cpp b/apps/shared/values_parameter_controller.cpp index 4aace8041..1dd0db71e 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(PointerTableCell((char*)"Effacer la colonne")), m_copyColumn(PointerTableCellWithChevron((char*)"Copier la colonne dans une liste")), m_setInterval(PointerTableCellWithChevron((char*)"Regler l'intervalle")), - m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin, + m_selectableTableView(SelectableTableView(this, this, 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 ff231ccf0..cdc3a6957 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, 0, 0, 0, 0, nullptr, false)) + m_selectableTableView(SelectableTableView(this, this, 1, 0, 0, 0, 0, nullptr, false)) { } diff --git a/apps/variable_box_leaf_cell.cpp b/apps/variable_box_leaf_cell.cpp index 964e15666..033a5a74c 100644 --- a/apps/variable_box_leaf_cell.cpp +++ b/apps/variable_box_leaf_cell.cpp @@ -38,7 +38,7 @@ void VariableBoxLeafCell::layoutSubviews() { KDCoordinate height = bounds().height(); if (numberOfSubviews() == 3) { m_labelView.setFrame(KDRect(1, 1, width/2-1, height/2 - 1)); - m_subtitleView.setFrame(KDRect(1, height/2, width/2-1, height/2 - 1)); + m_subtitleView.setFrame(KDRect(1, height/2, width/2-1, height/2)); m_subtitleView.setAlignment(0.0f, 0.5f); m_expressionView.setFrame(KDRect(width/2, 1, width/2-1, height-2)); return; @@ -74,8 +74,9 @@ void VariableBoxLeafCell::drawRect(KDContext * ctx, KDRect rect) const { KDCoordinate width = bounds().width(); KDCoordinate height = bounds().height(); KDColor backgroundColor = isHighlighted() ? Palette::Select : KDColorWhite; - ctx->fillRect(KDRect(1, 0, width-2, height-1), backgroundColor); + ctx->fillRect(KDRect(1, 0, width-2, height-2), backgroundColor); ctx->fillRect(KDRect(0, height-1, width, 1), Palette::GreyBright); + ctx->fillRect(KDRect(0, 0, width, 1), Palette::GreyBright); ctx->fillRect(KDRect(0, 0, 1, height-1), Palette::GreyBright); ctx->fillRect(KDRect(width-1, 0, 1, height-1), Palette::GreyBright); } diff --git a/escher/include/escher/selectable_table_view.h b/escher/include/escher/selectable_table_view.h index eca9c558e..e04cbb2a6 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, + SelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource, int cellOverlapping, 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 2ea131a07..8dfe98d51 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, KDCoordinate topMargin = 0, + TableView(TableViewDataSource * dataSource, int cellOverlapping, 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); + ContentView(TableView * tableView, TableViewDataSource * dataSource, int cellOverlapping); void scrollToCell(int i, int j) const; HighlightCell * cellAtLocation(int i, int j); @@ -67,6 +67,7 @@ protected: int typeIndexFromSubviewIndex(int index, int type) const; TableView * m_tableView; TableViewDataSource * m_dataSource; + int m_cellOverlapping; }; ContentView m_contentView; private: diff --git a/escher/src/selectable_table_view.cpp b/escher/src/selectable_table_view.cpp index d4c9c6b7f..2f1fd44f8 100644 --- a/escher/src/selectable_table_view.cpp +++ b/escher/src/selectable_table_view.cpp @@ -1,10 +1,10 @@ #include -SelectableTableView::SelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource, +SelectableTableView::SelectableTableView(Responder * parentResponder, TableViewDataSource * dataSource, int cellOverlapping, 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, topMargin, rightMargin, bottomMargin, leftMargin, showIndicators, colorBackground, backgroundColor, + TableView(dataSource, cellOverlapping, topMargin, rightMargin, bottomMargin, leftMargin, showIndicators, colorBackground, backgroundColor, indicatorThickness, indicatorColor, backgroundIndicatorColor, indicatorMargin), Responder(parentResponder), m_delegate(delegate), diff --git a/escher/src/table_cell.cpp b/escher/src/table_cell.cpp index 57aa340ae..1a7c01a99 100644 --- a/escher/src/table_cell.cpp +++ b/escher/src/table_cell.cpp @@ -41,10 +41,10 @@ void TableCell::layoutSubviews() { KDSize labelSize = label->minimalSizeForOptimalDisplay(); switch (m_layout) { case Layout::Vertical: - label->setFrame(KDRect(k_separatorThickness, k_separatorThickness, width-2*k_separatorThickness, labelSize.height())); + label->setFrame(KDRect(k_separatorThickness, k_separatorThickness, width-2*k_separatorThickness, labelSize.height())); break; default: - label->setFrame(KDRect(k_separatorThickness, k_separatorThickness, labelSize.width(), height - 2*k_separatorThickness)); + label->setFrame(KDRect(k_separatorThickness, k_separatorThickness, labelSize.width(), height - 2*k_separatorThickness)); break; } } @@ -89,4 +89,5 @@ void TableCell::drawRect(KDContext * ctx, KDRect rect) const { ctx->fillRect(KDRect(0, 0, width, k_separatorThickness), Palette::GreyBright); ctx->fillRect(KDRect(0, k_separatorThickness, k_separatorThickness, height-k_separatorThickness), Palette::GreyBright); ctx->fillRect(KDRect(width-k_separatorThickness, k_separatorThickness, k_separatorThickness, height-k_separatorThickness), Palette::GreyBright); + ctx->fillRect(KDRect(0, height-k_separatorThickness, width, k_separatorThickness), Palette::GreyBright); } diff --git a/escher/src/table_view.cpp b/escher/src/table_view.cpp index f0ca68123..747a9dc36 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, KDCoordinate topMargin, KDCoordinate rightMargin, +TableView::TableView(TableViewDataSource * dataSource, int cellOverlapping, 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)) + m_contentView(TableView::ContentView(this, dataSource, cellOverlapping)) { } @@ -56,10 +56,11 @@ void TableView::reloadData() { /* TableView::ContentView */ -TableView::ContentView::ContentView(TableView * tableView, TableViewDataSource * dataSource) : +TableView::ContentView::ContentView(TableView * tableView, TableViewDataSource * dataSource, int cellOverlapping) : View(), m_tableView(tableView), - m_dataSource(dataSource) + m_dataSource(dataSource), + m_cellOverlapping(cellOverlapping) { } @@ -83,7 +84,7 @@ void TableView::ContentView::resizeToFitContent() { } KDCoordinate TableView::ContentView::height() const { - return m_dataSource->cumulatedHeightFromIndex(m_dataSource->numberOfRows()); + return m_dataSource->cumulatedHeightFromIndex(m_dataSource->numberOfRows())+m_cellOverlapping; } KDCoordinate TableView::ContentView::width() const { @@ -107,7 +108,7 @@ void TableView::ContentView::scrollToCell(int x, int y) const { 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) - m_tableView->maxContentHeightDisplayableWithoutScrolling(); + contentOffsetY = m_dataSource->cumulatedHeightFromIndex(y+1)+2*m_cellOverlapping - m_tableView->maxContentHeightDisplayableWithoutScrolling(); } m_tableView->setContentOffset(KDPoint(contentOffsetX, contentOffsetY)); } @@ -183,7 +184,7 @@ void TableView::ContentView::layoutSubviews() { KDCoordinate verticalOffset = m_dataSource->cumulatedHeightFromIndex(j); KDCoordinate horizontalOffset = m_dataSource->cumulatedWidthFromIndex(i); KDRect cellFrame(horizontalOffset, verticalOffset, - columnWidth, rowHeight); + columnWidth, rowHeight+m_cellOverlapping); cell->setFrame(cellFrame);