From 5e7bfc795a95ddda5b97c3a40a0d3cf29498ab9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 23 Mar 2017 11:28:42 +0100 Subject: [PATCH] [apps/shared] Deselect table in float parameter controller when disappearing Change-Id: I59baf6b9d578b9d5045287f7c9ba65ff53abbda9 --- apps/probability/parameters_controller.cpp | 3 +++ apps/shared/range_parameter_controller.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/probability/parameters_controller.cpp b/apps/probability/parameters_controller.cpp index be91ee4e7..efb49ff59 100644 --- a/apps/probability/parameters_controller.cpp +++ b/apps/probability/parameters_controller.cpp @@ -111,6 +111,9 @@ int ParametersController::numberOfRows() { void ParametersController::willDisplayCellForIndex(HighlightCell * cell, int index) { if (index == numberOfRows()-1) { + if (m_selectableTableView.selectedRow() != numberOfRows()-1) { + cell->setHighlighted(false); + } return; } MessageTableCellWithEditableText * myCell = (MessageTableCellWithEditableText *) cell; diff --git a/apps/shared/range_parameter_controller.cpp b/apps/shared/range_parameter_controller.cpp index e82ab8d87..488e944e6 100644 --- a/apps/shared/range_parameter_controller.cpp +++ b/apps/shared/range_parameter_controller.cpp @@ -71,7 +71,9 @@ void RangeParameterController::tableViewDidChangeSelection(SelectableTableView * if (previousSelectedCellY < numberOfRows()-1 && previousSelectedCellY >= 0 && previousSelectedCellY !=2) { MessageTableCellWithEditableText * myCell = (MessageTableCellWithEditableText *)t->cellAtLocation(previousSelectedCellX, previousSelectedCellY); myCell->setEditing(false); - app()->setFirstResponder(t); + if (t->selectedRow() >= 0) { + app()->setFirstResponder(t); + } } if (t->selectedRow() == numberOfRows()-1) { Button * myNewCell = (Button *)t->cellAtLocation(t->selectedColumn(), t->selectedRow());