Bottom label, quit with MENU

master
Filip Wieland 2018-09-15 22:28:38 +01:00
parent e86d5955a3
commit 825741bdd5
2 changed files with 8 additions and 1 deletions

BIN
trains/bottom.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -4,7 +4,7 @@ import database
from time import time
from homescreen import time_as_string
from tilda import Buttons
from trains.screen import Screen, S_CONTINUE, S_TO_SETTINGS
from trains.screen import Screen, S_CONTINUE, S_TO_SETTINGS, S_EXIT
from trains.api import get_trains
from trains.utils import get_departure, get_title, is_red
@ -30,6 +30,12 @@ class DepartureScreen(Screen):
on_press=True,
on_release=False
)
Buttons.enable_interrupt(
Buttons.BTN_Menu,
lambda t: self.set_next_state(S_EXIT),
on_press=True,
on_release=False
)
def set_next_state(self, s):
self.next_state = s
@ -97,6 +103,7 @@ class DepartureScreen(Screen):
ugfx.text(195, 25 + (15 * row_num), departure,ugfx.RED if is_red(service) else ugfx.BLUE)
row_num += 1
ugfx.display_image(0, 300, 'trains/bottom.gif')
self.should_redraw = False
def show_error(self):