Anker-Konfigurationsseite, erste Versuche mit Menü

This commit is contained in:
2025-07-21 19:59:40 +02:00
parent 664d6c7d49
commit 986d222a98
6 changed files with 175 additions and 30 deletions

View File

@@ -77,6 +77,8 @@ class Page():
self.icon = {}
self.icon['PREV'] = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "arrow_l1.png"))
self.icon['NEXT'] = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "arrow_r1.png"))
self.icon['UP'] = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "arrow_up.png"))
self.icon['DOWN'] = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "arrow_dn.png"))
self.icon['ILUM'] = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "lighton.png"))
self.sym_lock = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "lock.png"))
self.sym_swipe = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "swipe3.png"))
@@ -276,3 +278,22 @@ class Page():
ctx.move_to(x - w, y)
ctx.show_text(content)
ctx.stroke()
def draw_text_boxed(self, ctx, x, y, w, h, content, inverted=False):
ctx.set_line_width(1)
if inverted:
ctx.set_source_rgb(*self.fgcolor)
ctx.rectangle(x, y + 0.5, w, h)
ctx.fill()
else:
ctx.set_source_rgb(*self.bgcolor)
ctx.rectangle(x, y + 0.5, w, h)
ctx.stroke()
if inverted:
ctx.set_source_rgb(*self.bgcolor)
else:
ctx.set_source_rgb(*self.fgcolor)
ctx.move_to(x + 4, y + h - 5 + 0.5)
ctx.show_text(content)
ctx.stroke()