Update only some parts of the display

This commit is contained in:
Ander Orbegozo
2016-10-08 02:17:49 +02:00
parent 1fe68e9d94
commit c3c2a67c7c
10 changed files with 113 additions and 87 deletions

View File

@@ -11,7 +11,7 @@ class MenuScreen(BaseScreen):
BaseScreen.__init__(self, size, base_size, manager, fonts)
self.ip = None
self.core = core
self.list = ListView((0, 0), (size[0], size[1]-base_size),
self.list = ListView((0, 0), size,
base_size, fonts['base'])
self.list_items = ["Random", "Repeat", "Single", "Consume",
@@ -22,6 +22,10 @@ class MenuScreen(BaseScreen):
def should_update(self):
return self.list.should_update()
def find_update_rects(self, rects):
return self.list_view.find_update_rects(rects)
def update(self, screen, update_type, rects):
update_all = (update_type == BaseScreen.update_all)
self.list.render(screen, update_all, rects)