diff --git a/apps/graph/graph/tangent_graph_controller.cpp b/apps/graph/graph/tangent_graph_controller.cpp index 6fac9385d..a585bf34e 100644 --- a/apps/graph/graph/tangent_graph_controller.cpp +++ b/apps/graph/graph/tangent_graph_controller.cpp @@ -62,4 +62,10 @@ bool TangentGraphController::moveCursorHorizontally(int direction) { return privateMoveCursorHorizontally(m_cursor, direction, m_graphRange, k_numberOfCursorStepsInGradUnit, m_function, myApp, k_cursorTopMarginRatio, k_cursorRightMarginRatio, k_cursorBottomMarginRatio, k_cursorLeftMarginRatio); } +bool TangentGraphController::handleEnter() { + StackViewController * stack = static_cast(parentResponder()); + stack->pop(); + return true; +} + } diff --git a/apps/graph/graph/tangent_graph_controller.h b/apps/graph/graph/tangent_graph_controller.h index c4da768cc..c1850dcba 100644 --- a/apps/graph/graph/tangent_graph_controller.h +++ b/apps/graph/graph/tangent_graph_controller.h @@ -24,6 +24,7 @@ private: BannerView * bannerView() override { return m_bannerView; }; void reloadBannerView() override; bool moveCursorHorizontally(int direction) override; + bool handleEnter() override; GraphView * m_graphView; BannerView * m_bannerView; Shared::InteractiveCurveViewRange * m_graphRange; diff --git a/apps/shared/interactive_curve_view_controller.cpp b/apps/shared/interactive_curve_view_controller.cpp index c74586da7..11736713e 100644 --- a/apps/shared/interactive_curve_view_controller.cpp +++ b/apps/shared/interactive_curve_view_controller.cpp @@ -71,9 +71,6 @@ bool InteractiveCurveViewController::handleEvent(Ion::Events::Event event) { header()->setSelectedButton(0); return true; } - if (event == Ion::Events::OK || event == Ion::Events::EXE) { - return handleEnter(); - } return false; } diff --git a/apps/shared/interactive_curve_view_controller.h b/apps/shared/interactive_curve_view_controller.h index 6ea425278..69561f88a 100644 --- a/apps/shared/interactive_curve_view_controller.h +++ b/apps/shared/interactive_curve_view_controller.h @@ -30,7 +30,6 @@ public: void didEnterResponderChain(Responder * previousFirstResponder) override; void willExitResponderChain(Responder * nextFirstResponder) override; protected: - virtual bool handleEnter() = 0; Responder * tabController() const; virtual StackViewController * stackController() const; virtual void initRangeParameters() = 0; diff --git a/apps/shared/simple_interactive_curve_view_controller.cpp b/apps/shared/simple_interactive_curve_view_controller.cpp index c465993eb..ac572b425 100644 --- a/apps/shared/simple_interactive_curve_view_controller.cpp +++ b/apps/shared/simple_interactive_curve_view_controller.cpp @@ -23,6 +23,9 @@ bool SimpleInteractiveCurveViewController::handleEvent(Ion::Events::Event event) if (event == Ion::Events::Left || event == Ion::Events::Right) { return handleLeftRightEvent(event); } + if (event == Ion::Events::EXE || event == Ion::Events::OK) { + return handleEnter(); + } return false; } diff --git a/apps/shared/simple_interactive_curve_view_controller.h b/apps/shared/simple_interactive_curve_view_controller.h index 3c0d91b35..68d55a787 100644 --- a/apps/shared/simple_interactive_curve_view_controller.h +++ b/apps/shared/simple_interactive_curve_view_controller.h @@ -29,6 +29,7 @@ protected: virtual bool moveCursorHorizontally(int direction) { return false; }; virtual InteractiveCurveViewRange * interactiveCurveViewRange() = 0; virtual CurveView * curveView() = 0; + virtual bool handleEnter() = 0; CurveViewCursor * m_cursor; }; diff --git a/apps/shared/sum_graph_controller.h b/apps/shared/sum_graph_controller.h index 1b6a3bd0e..4915de927 100644 --- a/apps/shared/sum_graph_controller.h +++ b/apps/shared/sum_graph_controller.h @@ -45,7 +45,7 @@ private: TextFieldDelegateApp * textFieldDelegateApp() override { return static_cast(app()); } - bool handleEnter(); + bool handleEnter() override; class LegendView : public View { public: LegendView(SumGraphController * controller, char sumSymbol);