From 8b7e243d2d4ff41417b204f14bb8599817802534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Fri, 30 Aug 2019 16:05:29 +0200 Subject: [PATCH] [apps/graph/list] Handle right event to open submenu --- apps/graph/list/list_parameter_controller.cpp | 14 ++++++++++++++ apps/graph/list/list_parameter_controller.h | 1 + 2 files changed, 15 insertions(+) diff --git a/apps/graph/list/list_parameter_controller.cpp b/apps/graph/list/list_parameter_controller.cpp index 14d3b7205..8e63fdeda 100644 --- a/apps/graph/list/list_parameter_controller.cpp +++ b/apps/graph/list/list_parameter_controller.cpp @@ -23,6 +23,20 @@ HighlightCell * ListParameterController::reusableCell(int index, int type) { } } +bool ListParameterController::handleEvent(Ion::Events::Event event) { + if (Shared::ListParameterController::handleEvent(event)) { + return true; + } + if (event == Ion::Events::Right) { + int selectedR = selectedRow(); + if (selectedR == 0 || selectedR == 1) { + // Go in the submenu + return handleEnterOnRow(selectedR); + } + } + return false; +} + void ListParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) { Shared::ListParameterController::willDisplayCellForIndex(cell, index); if ((cell == &m_typeCell || cell == &m_functionDomain) && !m_record.isNull()) { diff --git a/apps/graph/list/list_parameter_controller.h b/apps/graph/list/list_parameter_controller.h index 474ec2902..41f222a54 100644 --- a/apps/graph/list/list_parameter_controller.h +++ b/apps/graph/list/list_parameter_controller.h @@ -19,6 +19,7 @@ public: m_domainParameterController(nullptr, inputEventHandlerDelegate), m_renameCell(I18n::Message::Rename) {} + bool handleEvent(Ion::Events::Event event) override; // ListViewDataSource HighlightCell * reusableCell(int index, int type) override; void willDisplayCellForIndex(HighlightCell * cell, int index) override;