mirror of
https://github.com/Febbweiss/mopidy-touchscreen.git
synced 2026-03-05 06:35:43 +00:00
Fixed main screen update
This commit is contained in:
@@ -45,11 +45,13 @@ class MainScreen():
|
|||||||
self.core.playback.time_position.get() / 1000)) + "/" +
|
self.core.playback.time_position.get() / 1000)) + "/" +
|
||||||
time.strftime('%M:%S', time.gmtime(
|
time.strftime('%M:%S', time.gmtime(
|
||||||
self.track.length / 1000)))
|
self.track.length / 1000)))
|
||||||
if update_all:
|
if update_all:
|
||||||
if self.image_now_loaded:
|
|
||||||
if self.image is not None:
|
if self.image is not None:
|
||||||
screen.blit(self.image, (self.base_size / 2, self.base_size + self.base_size / 2))
|
screen.blit(self.image, (self.base_size / 2, self.base_size + self.base_size / 2))
|
||||||
self.image_now_loaded = False
|
self.image_now_loaded = False
|
||||||
|
if self.image_now_loaded:
|
||||||
|
screen.blit(self.image, (self.base_size / 2, self.base_size + self.base_size / 2))
|
||||||
|
self.image_now_loaded = False
|
||||||
self.touch_text_manager.render(screen)
|
self.touch_text_manager.render(screen)
|
||||||
return screen
|
return screen
|
||||||
|
|
||||||
@@ -187,8 +189,9 @@ class MainScreen():
|
|||||||
self.touch_text_manager.set_object("artist_name", current)
|
self.touch_text_manager.set_object("artist_name", current)
|
||||||
|
|
||||||
def track_playback_ended(self, tl_track, time_position):
|
def track_playback_ended(self, tl_track, time_position):
|
||||||
|
if self.image is not None:
|
||||||
self.image = None
|
self.dirty_area.append(self.image.get_rect())
|
||||||
|
self.image = None
|
||||||
|
|
||||||
# There is no cover so it will use all the screen size for the text
|
# There is no cover so it will use all the screen size for the text
|
||||||
width = self.size[0] - self.base_size
|
width = self.size[0] - self.base_size
|
||||||
|
|||||||
Reference in New Issue
Block a user