scheletro porting nativo Sailfish OS di Henflow: packaging, settings, pagine, icone, i18n

This commit is contained in:
Carlo Baratto
2026-10-08 22:10:51 +02:00
commit 7cef6954eb
17 changed files with 674 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
#!/usr/bin/env python3
"""Genera le icone dell'app in stile Sailfish OS:
sfondo a gradiente ambrato->arancio bruciato con angoli molto arrotondati,
un uovo bianco con ombra morbida e una pagliuzza di grano.
Dimensioni: 86, 108, 128, 172 (struttura standard hicolor)."""
import os
from PIL import Image, ImageDraw
C_TOP = (250, 214, 137) # #FAD689 ambrato chiaro
C_BOT = (196, 122, 41) # #C47A29 arancio bruciato
EGG = (255, 253, 246)
STRAW = (255, 236, 179)
def gradient(size, c1, c2):
img = Image.new("RGB", (size, size))
d = ImageDraw.Draw(img)
for y in range(size):
t = y / (size - 1)
d.line([(0, y), (size, y)],
fill=(int(c1[0] + (c2[0] - c1[0]) * t),
int(c1[1] + (c2[1] - c1[1]) * t),
int(c1[2] + (c2[2] - c1[2]) * t)))
return img
def draw_icon(size):
m = size * 0.05
r = size * 0.22
out = Image.new("RGBA", (size, size), (0, 0, 0, 0))
grad = gradient(size, C_TOP, C_BOT).convert("RGBA")
mask = Image.new("L", (size, size), 0)
ImageDraw.Draw(mask).rounded_rectangle([m, m, size - m, size - m],
radius=r, fill=255)
out.paste(grad, (0, 0), mask)
d = ImageDraw.Draw(out, "RGBA")
# pagliuzza: due archi chiari in basso, suggeriscono il nido
lw = max(2, int(size * 0.03))
for k, off in ((0.0, 0.0), (0.06, 0.03)):
d.arc([size * (0.16 + k), size * (0.62 + off),
size * (0.84 - k), size * (1.02 + off)],
start=200, end=340, fill=STRAW + (110,), width=lw)
# uovo bianco, leggermente spostato in alto, con ombra morbida
ex0, ey0 = size * 0.30, size * 0.22
ex1, ey1 = size * 0.70, size * 0.70
d.ellipse([ex0 + size * 0.015, ey0 + size * 0.02,
ex1 + size * 0.015, ey1 + size * 0.02],
fill=(90, 50, 10, 70))
d.ellipse([ex0, ey0, ex1, ey1], fill=EGG + (255,))
# riflesso
d.ellipse([size * 0.35, size * 0.30, size * 0.45, size * 0.40],
fill=(255, 255, 255, 120))
return out
def main():
for s in (86, 108, 128, 172):
os.makedirs(f"icons/{s}x{s}", exist_ok=True)
draw_icon(s).save(f"icons/{s}x{s}/harbour-henflow.png")
print("icone scritte: 86, 108, 128, 172")
if __name__ == "__main__":
main()