From 4396b3f190b4e669cfe7f78764c70ebc6cb50f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 9 Jun 2017 10:38:52 +0200 Subject: [PATCH] [apps/sequence|graph] Event on right on chevron cell behaves as OK Change-Id: I3ca047233c5ce637a29ee759153337c0c01cd073 --- apps/graph/graph/curve_parameter_controller.cpp | 2 +- apps/sequence/graph/curve_parameter_controller.cpp | 2 +- apps/shared/function_curve_parameter_controller.cpp | 4 +++- apps/shared/function_go_to_parameter_controller.cpp | 8 ++++++++ apps/shared/function_go_to_parameter_controller.h | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/graph/graph/curve_parameter_controller.cpp b/apps/graph/graph/curve_parameter_controller.cpp index dd10280fb..40bc24596 100644 --- a/apps/graph/graph/curve_parameter_controller.cpp +++ b/apps/graph/graph/curve_parameter_controller.cpp @@ -27,7 +27,7 @@ void CurveParameterController::willDisplayCellForIndex(HighlightCell * cell, int } bool CurveParameterController::handleEvent(Ion::Events::Event event) { - if (event == Ion::Events::OK || event == Ion::Events::EXE) { + if (event == Ion::Events::OK || event == Ion::Events::EXE || (event == Ion::Events::Right && (selectedRow() == 0 || selectedRow() == 1))) { switch (selectedRow()) { case 0: return true; diff --git a/apps/sequence/graph/curve_parameter_controller.cpp b/apps/sequence/graph/curve_parameter_controller.cpp index 88a5f7a7c..0a13bdade 100644 --- a/apps/sequence/graph/curve_parameter_controller.cpp +++ b/apps/sequence/graph/curve_parameter_controller.cpp @@ -19,7 +19,7 @@ const char * CurveParameterController::title() { } bool CurveParameterController::handleEvent(Ion::Events::Event event) { - if (event == Ion::Events::OK || event == Ion::Events::EXE) { + if (event == Ion::Events::OK || event == Ion::Events::EXE || (event == Ion::Events::Right && selectedRow() == 1)) { switch (selectedRow()) { case 0: { diff --git a/apps/shared/function_curve_parameter_controller.cpp b/apps/shared/function_curve_parameter_controller.cpp index d88d5216e..4a51ff6af 100644 --- a/apps/shared/function_curve_parameter_controller.cpp +++ b/apps/shared/function_curve_parameter_controller.cpp @@ -17,7 +17,9 @@ View * FunctionCurveParameterController::view() { } void FunctionCurveParameterController::didBecomeFirstResponder() { - selectCellAtLocation(0, 0); + if (selectedRow() < 0) { + selectCellAtLocation(0, 0); + } app()->setFirstResponder(&m_selectableTableView); } diff --git a/apps/shared/function_go_to_parameter_controller.cpp b/apps/shared/function_go_to_parameter_controller.cpp index 89aeb8866..35e142897 100644 --- a/apps/shared/function_go_to_parameter_controller.cpp +++ b/apps/shared/function_go_to_parameter_controller.cpp @@ -41,4 +41,12 @@ void FunctionGoToParameterController::setFunction(Function * function) { m_function = function; } +bool FunctionGoToParameterController::handleEvent(Ion::Events::Event event) { + if (event == Ion::Events::Left) { + stackController()->pop(); + return true; + } + return false; +} + } diff --git a/apps/shared/function_go_to_parameter_controller.h b/apps/shared/function_go_to_parameter_controller.h index c00cf1ddd..f97dec1ee 100644 --- a/apps/shared/function_go_to_parameter_controller.h +++ b/apps/shared/function_go_to_parameter_controller.h @@ -11,6 +11,7 @@ public: FunctionGoToParameterController(Responder * parentResponder, InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor, I18n::Message symbol); const char * title() override; void setFunction(Function * function); + bool handleEvent(Ion::Events::Event event) override; protected: bool setParameterAtIndex(int parameterIndex, float f) override; Function * m_function;