Version 1.7.0: Feather Icons via Qt-Ressourcensystem eingebunden
Alle QIcon.fromTheme()-Aufrufe durch eingebettete Feather Icons ersetzt, die unter Windows zuverlässig funktionieren. Icons passen sich automatisch der Palette-Farbe des aktiven Themes an (QSvgRenderer + currentColor). - scripts/download_icons.py: lädt 20 Feather-SVGs von GitHub - src/res/icons/: 20 SVG-Dateien (MIT-Lizenz, stroke=currentColor) - src/res/resources.qrc + resources_rc.py: Qt-Ressourcensystem - src/icons.py: icon()-Hilfsfunktion mit Palette-Farb-Injection - MainWindow, AppSettings, XslDependencyDialog, tree_manager, XsltParamsEditDialog, ProjectXsltParamsDialog: Icons gesetzt - Theme-Wechsel aktualisiert Icons und Tree-Items sofort - THIRD_PARTY_LICENSES.txt: Feather Icons (MIT) eingetragen Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
"""
|
||||
Lädt Feather Icons (MIT-Lizenz) von GitHub herunter und speichert sie in src/res/icons/.
|
||||
Stroke-Farbe wird auf #444444 gesetzt für bessere Sichtbarkeit in hellen und dunklen Themes.
|
||||
|
||||
Ausführung: uv run python scripts/download_icons.py
|
||||
"""
|
||||
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
ICONS = [
|
||||
"folder-plus",
|
||||
"log-out",
|
||||
"settings",
|
||||
"folder",
|
||||
"refresh-cw",
|
||||
"plus-circle",
|
||||
"minus-circle",
|
||||
"play-circle",
|
||||
"file",
|
||||
"check-circle",
|
||||
"info",
|
||||
"git-branch",
|
||||
"file-text",
|
||||
"code",
|
||||
"chevron-down",
|
||||
"chevron-up",
|
||||
"trash-2",
|
||||
"file-plus",
|
||||
"columns",
|
||||
"sliders",
|
||||
"folder-open",
|
||||
]
|
||||
|
||||
BASE_URL = "https://raw.githubusercontent.com/feathericons/feather/master/icons/{name}.svg"
|
||||
OUTPUT_DIR = Path(__file__).parent.parent / "src" / "res" / "icons"
|
||||
|
||||
|
||||
def download_icons():
|
||||
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
success = 0
|
||||
failed = []
|
||||
|
||||
for name in ICONS:
|
||||
url = BASE_URL.format(name=name)
|
||||
dest = OUTPUT_DIR / f"{name}.svg"
|
||||
|
||||
if dest.exists():
|
||||
print(f" [OK] {name}.svg (bereits vorhanden)")
|
||||
success += 1
|
||||
continue
|
||||
|
||||
try:
|
||||
with urllib.request.urlopen(url, timeout=10) as response:
|
||||
content = response.read().decode("utf-8")
|
||||
|
||||
content = content.replace('stroke="#000000"', 'stroke="#444444"')
|
||||
content = content.replace("stroke='#000000'", "stroke='#444444'")
|
||||
|
||||
dest.write_text(content, encoding="utf-8")
|
||||
print(f" [OK] {name}.svg")
|
||||
success += 1
|
||||
|
||||
except Exception as e:
|
||||
print(f" [FEHLER] {name}.svg: {e}")
|
||||
failed.append(name)
|
||||
|
||||
print(f"\n{success}/{len(ICONS)} Icons heruntergeladen nach {OUTPUT_DIR}")
|
||||
if failed:
|
||||
print(f"Fehlgeschlagen: {', '.join(failed)}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Lade {len(ICONS)} Feather Icons herunter ...")
|
||||
download_icons()
|
||||
Reference in New Issue
Block a user