diff --git a/apps/graph/graph/graph_controller.cpp b/apps/graph/graph/graph_controller.cpp index d340d53c6..b9756d88f 100644 --- a/apps/graph/graph/graph_controller.cpp +++ b/apps/graph/graph/graph_controller.cpp @@ -33,14 +33,6 @@ void GraphController::viewWillAppear() { selectFunctionWithCursor(indexFunctionSelectedByCursor()); // update the color of the cursor } -bool GraphController::displayDerivativeInBanner() const { - return m_displayDerivativeInBanner; -} - -void GraphController::setDisplayDerivativeInBanner(bool displayDerivative) { - m_displayDerivativeInBanner = displayDerivative; -} - float GraphController::interestingXHalfRange() const { float characteristicRange = 0.0f; Poincare::Context * context = textFieldDelegateApp()->localContext(); @@ -54,20 +46,12 @@ float GraphController::interestingXHalfRange() const { return (characteristicRange > 0.0f ? 1.6f*characteristicRange : InteractiveCurveViewRangeDelegate::interestingXHalfRange()); } -int GraphController::estimatedBannerNumberOfLines() const { - return 1 + m_displayDerivativeInBanner; -} - void GraphController::selectFunctionWithCursor(int functionIndex) { FunctionGraphController::selectFunctionWithCursor(functionIndex); ExpiringPointer f = functionStore()->modelForRecord(functionStore()->activeRecordAtIndex(functionIndex)); m_cursorView.setColor(f->color()); } -BannerView * GraphController::bannerView() { - return &m_bannerView; -} - void GraphController::reloadBannerView() { FunctionGraphController::reloadBannerView(); if (!m_displayDerivativeInBanner) { @@ -82,16 +66,4 @@ bool GraphController::moveCursorHorizontally(int direction) { return privateMoveCursorHorizontally(m_cursor, direction, m_graphRange, k_numberOfCursorStepsInGradUnit, record); } -InteractiveCurveViewRange * GraphController::interactiveCurveViewRange() { - return m_graphRange; -} - -GraphView * GraphController::functionGraphView() { - return &m_view; -} - -CurveParameterController * GraphController::curveParameterController() { - return &m_curveParameterController; -} - } diff --git a/apps/graph/graph/graph_controller.h b/apps/graph/graph/graph_controller.h index 2b7719e27..17bb98039 100644 --- a/apps/graph/graph/graph_controller.h +++ b/apps/graph/graph/graph_controller.h @@ -18,18 +18,18 @@ public: GraphController(Responder * parentResponder, ::InputEventHandlerDelegate * inputEventHandlerDelegate, CartesianFunctionStore * functionStore, Shared::InteractiveCurveViewRange * curveViewRange, Shared::CurveViewCursor * cursor, int * indexFunctionSelectedByCursor, uint32_t * modelVersion, uint32_t * rangeVersion, Poincare::Preferences::AngleUnit * angleUnitVersion, ButtonRowController * header); I18n::Message emptyMessage() override; void viewWillAppear() override; - bool displayDerivativeInBanner() const; - void setDisplayDerivativeInBanner(bool displayDerivative); + bool displayDerivativeInBanner() const { return m_displayDerivativeInBanner; } + void setDisplayDerivativeInBanner(bool displayDerivative) { m_displayDerivativeInBanner = displayDerivative; } float interestingXHalfRange() const override; private: - int estimatedBannerNumberOfLines() const override; + int estimatedBannerNumberOfLines() const override { return 1 + m_displayDerivativeInBanner; } void selectFunctionWithCursor(int functionIndex) override; - BannerView * bannerView() override; + BannerView * bannerView() override { return &m_bannerView; } void reloadBannerView() override; bool moveCursorHorizontally(int direction) override; - Shared::InteractiveCurveViewRange * interactiveCurveViewRange() override; - GraphView * functionGraphView() override; - CurveParameterController * curveParameterController() override; + Shared::InteractiveCurveViewRange * interactiveCurveViewRange() override { return m_graphRange; } + GraphView * functionGraphView() override { return &m_view; } + CurveParameterController * curveParameterController() override { return &m_curveParameterController; } CartesianFunctionStore * functionStore() const override { return static_cast(Shared::FunctionGraphController::functionStore()); } Shared::RoundCursorView m_cursorView; BannerView m_bannerView; diff --git a/apps/shared/banner_view.cpp b/apps/shared/banner_view.cpp index 43fae4dfc..bd556f6f8 100644 --- a/apps/shared/banner_view.cpp +++ b/apps/shared/banner_view.cpp @@ -28,10 +28,10 @@ void BannerView::layoutSubviews() { return; } /* We iterate on subviews, adding their width until we exceed the view bound. - * The last subview that exceeds the bound is recorded as the first subview of - * the next line. For the current line, we scan again the subviews and frame - * them by equally distributing the remaining width. We then jump to the next - * line and iterate the process. */ + * The last subview that exceeds the bound is recorded as the first subview of + * the next line. For the current line, we scan again the subviews and frame + * them by equally distributing the remaining width. We then jump to the next + * line and iterate the process. */ const KDCoordinate lineWidth = m_frame.width(); KDCoordinate remainingWidth = lineWidth; int indexOfFirstViewOfCurrentLine = 0;