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

@@ -8,9 +8,7 @@ from ..graphic_utils import ListView
class LibraryScreen(BaseScreen):
def __init__(self, size, base_size, manager, fonts):
BaseScreen.__init__(self, size, base_size, manager, fonts)
self.list_view = ListView((0, 0), (
self.size[0], self.size[1] -
self.base_size), self.base_size, self.fonts['base'])
self.list_view = ListView((0, 0), self.size, self.base_size, self.fonts['base'])
self.directory_list = []
self.current_directory = None
self.library = None
@@ -40,6 +38,9 @@ class LibraryScreen(BaseScreen):
def should_update(self):
return self.list_view.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_view.render(screen, update_all, rects)