diff --git a/MANIFEST.in b/MANIFEST.in index e7642bd..b325d23 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,5 +4,6 @@ include LICENSE include MANIFEST.in include README.rst include mopidy_touchscreen/ext.conf +include mopidy_touchscreen/icomoon.ttf -recursive-include tests *.py \ No newline at end of file +recursive-include tests *.py diff --git a/mopidy_touchscreen/icomoon.ttf b/mopidy_touchscreen/icomoon.ttf new file mode 100644 index 0000000..8433147 Binary files /dev/null and b/mopidy_touchscreen/icomoon.ttf differ diff --git a/mopidy_touchscreen/screen_manager.py b/mopidy_touchscreen/screen_manager.py index 47e71d5..18d4067 100644 --- a/mopidy_touchscreen/screen_manager.py +++ b/mopidy_touchscreen/screen_manager.py @@ -14,6 +14,7 @@ from .dynamic_background import DynamicBackground from .library_screen import LibraryScreen from .menu_screen import MenuScreen +from pkg_resources import Requirement, resource_filename logger = logging.getLogger(__name__) @@ -27,7 +28,7 @@ class ScreenManager(): self.background = DynamicBackground() self.current_screen = 0 self.base_size = self.size[1] / 8 - font = os.path.join(os.path.dirname(os.path.realpath(__file__)), "fonts", "icomoon", "fonts", "icomoon.ttf") + font = resource_filename(Requirement.parse("mopidy-touchscreen"),"mopidy_touchscreen/icomoon.ttf") self.fonts['base'] = pygame.font.SysFont("verdana", self.base_size) self.fonts['icon'] = pygame.font.Font(font, self.base_size) try: diff --git a/mopidy_touchscreen/touch_screen.py b/mopidy_touchscreen/touch_screen.py index ac9c6a7..9274d6f 100644 --- a/mopidy_touchscreen/touch_screen.py +++ b/mopidy_touchscreen/touch_screen.py @@ -22,7 +22,7 @@ class TouchScreen(pykka.ThreadingActor, core.CoreListener): self.cache_dir = config['touchscreen']['cache_dir'] self.fullscreen = config['touchscreen']['fullscreen'] pygame.init() - pygame.mouse.set_visible(config['touchscreen']['cursor']) + self.cursor = config['touchscreen']['cursor'] self.screen_manager = ScreenManager(self.screen_size, self.core, self.backend, self.cache_dir) def start_thread(self): @@ -31,6 +31,7 @@ class TouchScreen(pykka.ThreadingActor, core.CoreListener): screen = pygame.display.set_mode(self.screen_size, pygame.FULLSCREEN) else: screen = pygame.display.set_mode(self.screen_size) + pygame.mouse.set_visible(self.cursor) while self.running: clock.tick(15) screen.blit(self.screen_manager.update(), (0, 0)) diff --git a/setuptools-5.4.2.zip b/setuptools-5.4.2.zip new file mode 100644 index 0000000..6be4f21 Binary files /dev/null and b/setuptools-5.4.2.zip differ