Skip to content
Snippets Groups Projects
Commit 20b61746 authored by dos's avatar dos Committed by ave
Browse files

py,st3m: ScrollController: Add set_position and scroll_to methods

parent 663bbd5a
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,18 @@ class ScrollController(st3m.Responder): ...@@ -50,6 +50,18 @@ class ScrollController(st3m.Responder):
count = 0 count = 0
self._nitems = count self._nitems = count
def set_position(self, position: int) -> None:
"""
Immediately set a position without animating the transition.
"""
self._target_position = self._current_position = position
def scroll_to(self, position: int) -> None:
"""
Scroll to specified position.
"""
self._target_position = position
def scroll_left(self) -> None: def scroll_left(self) -> None:
""" """
Call when the user wants to scroll left by discrete action (eg. button Call when the user wants to scroll left by discrete action (eg. button
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment