Skip to content
Snippets Groups Projects
Select Git revision
  • 0b7a8bc66c44bff645e5309684b508f5332bcc06
  • main default protected
  • phhw
  • captouch-threshold
  • t
  • dos
  • test2
  • test
  • slewtest
  • simtest
  • view-think
  • vm-pending
  • media-buf
  • scope
  • passthrough
  • wave
  • vsync
  • dos-main-patch-50543
  • json-error
  • rahix/big-flow3r
  • pippin/media_framework
  • v1.3.0
  • v1.2.0
  • v1.2.0+rc1
  • v1.1.1
  • v1.1.0
  • v1.1.0+rc1
  • v1.0.0
  • v1.0.0+rc6
  • v1.0.0+rc5
  • v1.0.0+rc4
  • v1.0.0+rc3
  • v1.0.0+rc2
  • v1.0.0+rc1
34 results

view.py

Blame
  • Forked from flow3r / flow3r firmware
    Source project has a limited visibility.
    application.py 817 B
    from st3m.ui.view import ViewWithInputState, ViewTransitionSwipeRight, ViewManager
    from st3m.input import InputState
    from st3m.goose import Optional
    
    
    class Application(ViewWithInputState):
        def __init__(self, name: str = __name__) -> None:
            self._name = name
            self._view_manager: Optional[ViewManager] = None
            super().__init__()
    
        def on_exit(self) -> None:
            pass
    
        def on_enter(self, vm: Optional[ViewManager]) -> None:
            self._view_manager = vm
            super().on_enter(vm)
    
        def think(self, ins: InputState, delta_ms: int) -> None:
            super().think(ins, delta_ms)
    
            if self.input.left_shoulder.middle.pressed:
                if self._view_manager is not None:
                    self.on_exit()
                    self._view_manager.pop(ViewTransitionSwipeRight())