mirror of
https://github.com/Febbweiss/mopidy-touchscreen.git
synced 2026-03-04 14:15:41 +00:00
Changed font to noto
Improved listview
This commit is contained in:
BIN
mopidy_touchscreen/NotoSans-Regular.ttf
Normal file
BIN
mopidy_touchscreen/NotoSans-Regular.ttf
Normal file
Binary file not shown.
BIN
mopidy_touchscreen/fonts/noto/NotoSans-Regular.ttf
Normal file
BIN
mopidy_touchscreen/fonts/noto/NotoSans-Regular.ttf
Normal file
Binary file not shown.
@@ -14,7 +14,7 @@ class ListView():
|
||||
self.pos = pos
|
||||
self.base_size = base_size
|
||||
self.screen_objects = ScreenObjectsManager()
|
||||
self.max_rows = self.size[1] / self.base_size
|
||||
self.max_rows = self.size[1] / font.size("TEXT SIZE")[1]
|
||||
self.current_item = 0
|
||||
self.font = font
|
||||
self.list_size = 0
|
||||
@@ -63,10 +63,12 @@ class ListView():
|
||||
else:
|
||||
width = self.size[0]
|
||||
self.should_update_always = False
|
||||
while i < self.list_size and z < self.max_rows:
|
||||
current_y = self.pos[1]
|
||||
while i < self.list_size and current_y <= self.pos[1] + self.size[1]:
|
||||
item = TouchAndTextItem(self.font, self.list[i], (
|
||||
self.pos[0],
|
||||
self.pos[1] + self.base_size * z), (width, -1))
|
||||
current_y), (width, -1))
|
||||
current_y += item.size[1]
|
||||
if not item.fit_horizontal:
|
||||
self.update_keys.append(str(i))
|
||||
self.screen_objects.set_touch_object(str(i), item)
|
||||
|
||||
@@ -54,12 +54,15 @@ class ScreenManager():
|
||||
self.base_size = self.size[1] / self.resolution_factor
|
||||
|
||||
self.background = DynamicBackground(self.size)
|
||||
font = resource_filename(
|
||||
font_icon = resource_filename(
|
||||
Requirement.parse("mopidy-touchscreen"),
|
||||
"mopidy_touchscreen/icomoon.ttf")
|
||||
self.fonts['base'] = pygame.font.SysFont("arial",
|
||||
int(self.base_size*0.9))
|
||||
self.fonts['icon'] = pygame.font.Font(font, int(self.base_size*0.9))
|
||||
|
||||
font_base = resource_filename(
|
||||
Requirement.parse("mopidy-touchscreen"),
|
||||
"mopidy_touchscreen/NotoSans-Regular.ttf")
|
||||
self.fonts['base'] = pygame.font.Font(font_base, int(self.base_size*0.9))
|
||||
self.fonts['icon'] = pygame.font.Font(font_icon, int(self.base_size*0.9))
|
||||
try:
|
||||
self.screens = [
|
||||
SearchScreen(size, self.base_size, self, self.fonts),
|
||||
|
||||
Reference in New Issue
Block a user