menu display work
This commit is contained in:
parent
564b083692
commit
12a9ff9033
@ -94,16 +94,18 @@ class SoundslabDisplay:
|
||||
menu_overlay.rectangle([(21,21), (self.screen_size[0] - 21, 61)], bg_color)
|
||||
if menu_data["has_previous"]:
|
||||
# draw triangle pointing up
|
||||
print("drawing has_previous triangle")
|
||||
menu_overlay.polygon([(floor(self.screen_size[0] / 2) - 20, 56), (floor(self.screen_size[0] / 2), 23), (floor(self.screen_size[0] / 2) + 20, 56)], fill=fg_color)
|
||||
# set up next indicator row
|
||||
menu_overlay.rectangle([(21, self.screen_size[1] - 21), (self.screen_size[0] - 21, self.screen_size[1] - 61)], bg_color)
|
||||
if menu_data["has_next"]:
|
||||
# draw triangle pointing down
|
||||
print("drawing has_next triangle")
|
||||
menu_overlay.polygon([(floor(self.screen_size[0] / 2) - 20, self.screen_size[1] - 56), (floor(self.screen_size[0] / 2), self.screen_size[1] - 23), (floor(self.screen_size[0] / 2) + 20, self.screen_size[1] - 56)], bg_color)
|
||||
|
||||
# draw three menu rows
|
||||
offset_from_top = 61 # start at the 21st row of pixels to draw inside the outer overlay, add 40 to account for the "prev" indicator row
|
||||
font = ImageFont.truetype(font='/usr/share/fonts/truetype/hack/Hack-Bold.ttf', size=16)
|
||||
font = ImageFont.truetype(font='/usr/share/fonts/truetype/hack/Hack-Bold.ttf', size=13)
|
||||
|
||||
for idx, row in enumerate(menu_data["rows"], start=0):
|
||||
if menu_data["selected"] == idx:
|
||||
|
Loading…
Reference in New Issue
Block a user