From 325d7be34fd4485f7da8417ed31c6a17168796b0 Mon Sep 17 00:00:00 2001 From: Carlo Baratto Date: Wed, 12 Aug 2026 14:54:44 +0200 Subject: [PATCH] Icone in struttura standard Sailfish (icons/86x86 e icons/108x108 con nome esatto) + yaml ripristinato in rpm/ --- harbour-calibreweb.pro | 9 ++++--- .../harbour-calibreweb.png} | Bin icons/{ => 86x86}/harbour-calibreweb.png | Bin icons/make_icons.py | 25 +++++++++--------- rpm/harbour-calibreweb.yaml | 15 +++++++++++ 5 files changed, 32 insertions(+), 17 deletions(-) rename icons/{harbour-calibreweb-108.png => 108x108/harbour-calibreweb.png} (100%) rename icons/{ => 86x86}/harbour-calibreweb.png (100%) create mode 100644 rpm/harbour-calibreweb.yaml diff --git a/harbour-calibreweb.pro b/harbour-calibreweb.pro index e7d876c..005c8f3 100644 --- a/harbour-calibreweb.pro +++ b/harbour-calibreweb.pro @@ -26,13 +26,14 @@ OTHER_FILES += \ qml/pages/*.qml \ qml/cover/*.qml \ rpm/harbour-calibreweb.spec \ - rpm/harbour-calibreweb.desktop + rpm/harbour-calibreweb.desktop \ + rpm/harbour-calibreweb.yaml DISTFILES += $$OTHER_FILES -# Icone installate via make install (path assoluti = robusti rispetto al tar sorgente) +# Icone installate via make install (struttura standard Sailfish: icons//.png) icons86.path = /usr/share/icons/hicolor/86x86/apps -icons86.files = $$PWD/icons/harbour-calibreweb.png +icons86.files = $$PWD/icons/86x86/harbour-calibreweb.png icons108.path = /usr/share/icons/hicolor/108x108/apps -icons108.files = $$PWD/icons/harbour-calibreweb-108.png +icons108.files = $$PWD/icons/108x108/harbour-calibreweb.png INSTALLS += icons86 icons108 diff --git a/icons/harbour-calibreweb-108.png b/icons/108x108/harbour-calibreweb.png similarity index 100% rename from icons/harbour-calibreweb-108.png rename to icons/108x108/harbour-calibreweb.png diff --git a/icons/harbour-calibreweb.png b/icons/86x86/harbour-calibreweb.png similarity index 100% rename from icons/harbour-calibreweb.png rename to icons/86x86/harbour-calibreweb.png diff --git a/icons/make_icons.py b/icons/make_icons.py index 207f99f..5aeec93 100644 --- a/icons/make_icons.py +++ b/icons/make_icons.py @@ -1,11 +1,13 @@ #!/usr/bin/env python3 -"""Genera le icone dell'app: harbour-calibreweb.png (86x86) e -108 (108x108).""" +"""Genera le icone dell'app nella struttura standard Sailfish: + icons/86x86/harbour-calibreweb.png e icons/108x108/harbour-calibreweb.png""" +import os from PIL import Image, ImageDraw -BG = (46, 52, 64) # #2E3440 -ACCENT = (136, 192, 208) # #88C0D0 -PAGE = (229, 233, 240) # #E5E9F0 -SPINE = (94, 129, 172) # #5E81AC +BG = (46, 52, 64) # #2E3440 +ACCENT = (136, 192, 208) # #88C0D0 +PAGE = (229, 233, 240) # #E5E9F0 +SPINE = (94, 129, 172) # #5E81AC def draw_icon(size): @@ -13,11 +15,9 @@ def draw_icon(size): d = ImageDraw.Draw(img) margin = size * 0.045 radius = size * 0.16 - # sfondo arrotondato d.rounded_rectangle([margin, margin, size - margin, size - margin], radius=radius, fill=BG) - # libro aperto: due pagine trapezoidali + dorso cx = size / 2 top = size * 0.34 bot = size * 0.68 @@ -30,11 +30,8 @@ def draw_icon(size): d.polygon(left_page, fill=ACCENT) d.polygon(right_page, fill=ACCENT) - - # dorso d.rectangle([cx - size * 0.014, top, cx + size * 0.014, bot], fill=SPINE) - # righe delle pagine lw = max(1, int(size * 0.012)) for y_frac in (0.45, 0.52, 0.59): y = size * y_frac @@ -46,9 +43,11 @@ def draw_icon(size): def main(): - draw_icon(108).save("icons/harbour-calibreweb-108.png") - draw_icon(86).save("icons/harbour-calibreweb.png") - print("icone scritte") + os.makedirs("icons/86x86", exist_ok=True) + os.makedirs("icons/108x108", exist_ok=True) + draw_icon(86).save("icons/86x86/harbour-calibreweb.png") + draw_icon(108).save("icons/108x108/harbour-calibreweb.png") + print("icone scritte in icons/86x86/ e icons/108x108/") if __name__ == "__main__": diff --git a/rpm/harbour-calibreweb.yaml b/rpm/harbour-calibreweb.yaml new file mode 100644 index 0000000..8fd7b3f --- /dev/null +++ b/rpm/harbour-calibreweb.yaml @@ -0,0 +1,15 @@ +Name: harbour-calibreweb +Summary: Client OPDS per Calibre Web +Version: 0.1.0 +Release: 1 +Group: Qt/Qt +License: MIT +URL: https://github.com/kaneda/harbour-calibreweb +Description: | + Client per navigare e scaricare libri da un'istanza Calibre Web + (o dal Content Server di Calibre) tramite il protocollo OPDS. + Supporta autenticazione di base, ricerca, copertine, lettore EPUB + e download in tutti i formati disponibili. +Sources: +- '%{name}-%{version}.tar.gz' +Builder: qmake5