diff --git a/apps/shared/simple_interactive_curve_view_controller.cpp b/apps/shared/simple_interactive_curve_view_controller.cpp index bf1354c1e..c9220f3d9 100644 --- a/apps/shared/simple_interactive_curve_view_controller.cpp +++ b/apps/shared/simple_interactive_curve_view_controller.cpp @@ -28,7 +28,7 @@ bool SimpleInteractiveCurveViewController::textFieldDidReceiveEvent(TextField * bool SimpleInteractiveCurveViewController::handleLeftRightEvent(Ion::Events::Event event) { int direction = event == Ion::Events::Left ? -1 : 1; - if (moveCursorHorizontally(direction, Ion::Events::longRepetitionScrollSpeed())) { + if (moveCursorHorizontally(direction, Ion::Events::repetitionFactor())) { interactiveCurveViewRange()->panToMakePointVisible( m_cursor->x(), m_cursor->y(), cursorTopMarginRatio(), k_cursorRightMarginRatio, cursorBottomMarginRatio(), k_cursorLeftMarginRatio diff --git a/apps/shared/store_selectable_table_view.cpp b/apps/shared/store_selectable_table_view.cpp index 5d547c79d..f7545ed4c 100644 --- a/apps/shared/store_selectable_table_view.cpp +++ b/apps/shared/store_selectable_table_view.cpp @@ -9,7 +9,7 @@ StoreSelectableTableView::StoreSelectableTableView(DoublePairStore * store, Resp } bool StoreSelectableTableView::handleEvent(Ion::Events::Event event) { - int step = Ion::Events::longRepetitionScrollSpeed(); + int step = Ion::Events::repetitionFactor(); if (event == Ion::Events::Down) { return selectNonHiddenCellAtClippedLocation(selectedColumn(), selectedRow() + step); } diff --git a/escher/src/layout_field.cpp b/escher/src/layout_field.cpp index 870a6c332..73b394c28 100644 --- a/escher/src/layout_field.cpp +++ b/escher/src/layout_field.cpp @@ -591,7 +591,7 @@ bool LayoutField::privateHandleMoveEvent(Ion::Events::Event event, bool * should return true; } LayoutCursor result; - int step = Ion::Events::longRepetitionScrollSpeed(); + int step = Ion::Events::repetitionFactor(); result = m_contentView.cursor()->cursorAtDirection(DirectionForMoveEvent(event), shouldRecomputeLayout, false, step); if (result.isDefined()) { if (eventShouldUpdateInsertionCursor(event)) { @@ -629,7 +629,7 @@ bool LayoutField::privateHandleSelectionEvent(Ion::Events::Event event, bool * s return false; } Layout addedSelection; - int step = Ion::Events::longRepetitionScrollSpeed(); + int step = Ion::Events::repetitionFactor(); LayoutCursor result = m_contentView.cursor()->selectAtDirection( DirectionForSelectionEvent(event), shouldRecomputeLayout, diff --git a/escher/src/scrollable_view.cpp b/escher/src/scrollable_view.cpp index 27707bef8..c198052a5 100644 --- a/escher/src/scrollable_view.cpp +++ b/escher/src/scrollable_view.cpp @@ -12,7 +12,7 @@ ScrollableView::ScrollableView(Responder * parentResponder, View * view, ScrollV bool ScrollableView::handleEvent(Ion::Events::Event event) { KDPoint translation = KDPointZero; - KDCoordinate scrollStep = Ion::Events::longRepetitionScrollSpeed() * Metric::ScrollStep; + KDCoordinate scrollStep = Ion::Events::repetitionFactor() * Metric::ScrollStep; if (event == Ion::Events::Left) { KDCoordinate movementToEdge = contentOffset().x(); if (movementToEdge > 0) { diff --git a/escher/src/selectable_table_view.cpp b/escher/src/selectable_table_view.cpp index 854964760..6d958ed03 100644 --- a/escher/src/selectable_table_view.cpp +++ b/escher/src/selectable_table_view.cpp @@ -151,7 +151,7 @@ HighlightCell * SelectableTableView::selectedCell() { } bool SelectableTableView::handleEvent(Ion::Events::Event event) { - int step = Ion::Events::longRepetitionScrollSpeed(); + int step = Ion::Events::repetitionFactor(); if (event == Ion::Events::Down) { return selectCellAtClippedLocation(selectedColumn(), selectedRow() + step); } diff --git a/escher/src/text_area.cpp b/escher/src/text_area.cpp index 2e24fdaad..76e7c0386 100644 --- a/escher/src/text_area.cpp +++ b/escher/src/text_area.cpp @@ -106,7 +106,7 @@ bool TextArea::handleEvent(Ion::Events::Event event) { if (handleBoxEvent(event)) { return true; } - int step = Ion::Events::longRepetitionScrollSpeed(); + int step = Ion::Events::repetitionFactor(); if (event == Ion::Events::ShiftLeft || event == Ion::Events::ShiftRight) { selectLeftRight(event == Ion::Events::ShiftLeft, false, step); return true; diff --git a/ion/include/ion/events.h b/ion/include/ion/events.h index 19e1b0c67..9e3d7b72f 100644 --- a/ion/include/ion/events.h +++ b/ion/include/ion/events.h @@ -58,8 +58,7 @@ bool isShiftActive(); bool isAlphaActive(); bool isLockActive(); void setLongRepetition(bool longRepetition); -bool isLongRepetition(); -int longRepetitionScrollSpeed(); +int repetitionFactor(); void updateModifiersFromEvent(Event e); void didPressNewKey(); diff --git a/ion/src/shared/events_modifier.cpp b/ion/src/shared/events_modifier.cpp index b97b5376e..79be23553 100644 --- a/ion/src/shared/events_modifier.cpp +++ b/ion/src/shared/events_modifier.cpp @@ -37,11 +37,7 @@ void setLongRepetition(bool longRepetition) { sLongRepetition = longRepetition; } -bool isLongRepetition() { - return sLongRepetition; -} - -int longRepetitionScrollSpeed() { +int repetitionFactor() { return sLongRepetition ? 5 : 1; };