0.6.7: icone sui tre tasti delle azioni rapide (fiamma, casa, manopole), disegnate in casa
This commit is contained in:
@@ -503,12 +503,20 @@ def main_screen() -> Image.Image:
|
||||
# ---- azioni rapide ----------------------------------------------------- #
|
||||
y = section_header(d, y, T("quick_actions"))
|
||||
bw = (W - 2 * M - 2 * gap) // 3
|
||||
# icona a sinistra e testo di fianco, come fa il pulsante Silica
|
||||
glifi = ("quick-boost.png", "quick-away.png", "quick-commands.png")
|
||||
for i, testo in enumerate((T("boost"), T("away_btn"), T("commands"))):
|
||||
x = M + i * (bw + gap)
|
||||
d.rounded_rectangle([x, y, x + bw, y + 74], radius=18, fill=BTN_BG,
|
||||
outline=BTN_EDGE, width=2)
|
||||
icona = Image.open(OUT.parent.parent / "qml" / "icons" / glifi[i]).convert("RGBA")
|
||||
lato = 42
|
||||
icona = icona.resize((lato, lato), Image.LANCZOS)
|
||||
tw = d.textlength(testo, font=font(24))
|
||||
d.text((x + (bw - tw) / 2, y + 23), testo, font=font(24), fill=PRIMARY)
|
||||
blocco = lato + 12 + tw
|
||||
x0 = x + (bw - blocco) / 2
|
||||
img.paste(icona, (int(x0), int(y + (74 - lato) / 2)), icona)
|
||||
d.text((x0 + lato + 12, y + 23), testo, font=font(24), fill=PRIMARY)
|
||||
y += 104
|
||||
|
||||
# ---- letture di contorno ----------------------------------------------- #
|
||||
|
||||
Reference in New Issue
Block a user