From 1dc9c5cc3dcc9fc92eec095aabe62052f7924cbc Mon Sep 17 00:00:00 2001 From: Jeff Patterson Date: Sun, 4 Oct 2026 08:42:59 -0500 Subject: [PATCH] Served the app icon from the icon theme in the new element wizard The qet theme now lists Nuri's app icon PNGs under the name qelectrotech, and the wizard loads its logo by that name instead of the 256 px file path. The files stay in ico/breeze-icons/, where the packaging scripts install them from. Part of #1269. --- ico/icon-themes.qrc | 6 ++++++ misc/make_icon_themes.py | 11 +++++++++++ qelectrotech.qrc | 1 - sources/newelementwizard.cpp | 3 ++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ico/icon-themes.qrc b/ico/icon-themes.qrc index 41889c2db..7ea5f7b3a 100644 --- a/ico/icon-themes.qrc +++ b/ico/icon-themes.qrc @@ -4,6 +4,12 @@ themes/qet/index.theme themes/qet-dark/index.theme + breeze-icons/16x16/apps/qelectrotech.png + breeze-icons/22x22/apps/qelectrotech.png + breeze-icons/32x32/apps/qelectrotech.png + breeze-icons/48x48/apps/qelectrotech.png + breeze-icons/64x64/apps/qelectrotech.png + breeze-icons/128x128/apps/qelectrotech.png qet/scalable/align-horizontal-center.svg qet/scalable/align-horizontal-left.svg qet/scalable/align-horizontal-right.svg diff --git a/misc/make_icon_themes.py b/misc/make_icon_themes.py index b44474333..7a784c7d2 100644 --- a/misc/make_icon_themes.py +++ b/misc/make_icon_themes.py @@ -314,6 +314,10 @@ BREEZE_PAGES = { PAGES = {name: f"breeze/{size}/{breeze}.svg" for name, (breeze, size) in BREEZE_PAGES.items()} PAGES["configure-shortcuts"] = "qet/pages/configure-shortcuts.svg" +# The app icon's theme name. Its PNGs, one per size, stay in +# ico/breeze-icons//apps/, where the packaging scripts install them from. +APP_ICON = "qelectrotech" + # Where the generator puts the 22 pixel Breeze art moved onto a 24 pixel # canvas (see on_24_canvas). BREEZE_24 = GENERATED / "breeze-24" @@ -645,6 +649,13 @@ def main(): changed += write_if_changed(target, dark_image) dark.append(f"themes/qet-dark/{size}/{name}.png") + # The app icon: Nuri's PNGs, used as they are. Colored art, so the + # dark theme inherits it. + for size in SIZES: + rel = f"breeze-icons/{size}/apps/{APP_ICON}.png" + if (ICO / rel).exists(): + light.append((f"themes/qet/{size}/{APP_ICON}.png", rel)) + svgs = [((ICO / rel).name.replace("-symbolic", ""), rel) for rel in SVGS] svgs += [(f"{name}.svg", rel) for name, rel in PAGES.items()] for name, rel in svgs: diff --git a/qelectrotech.qrc b/qelectrotech.qrc index 53c3663c5..cee4ba607 100644 --- a/qelectrotech.qrc +++ b/qelectrotech.qrc @@ -1,6 +1,5 @@ - ico/256x256/qelectrotech.png ico/256x256/qet.png ico/splash.png titleblocks/default.titleblock diff --git a/sources/newelementwizard.cpp b/sources/newelementwizard.cpp index 3cd3870e8..017f91a22 100644 --- a/sources/newelementwizard.cpp +++ b/sources/newelementwizard.cpp @@ -25,6 +25,7 @@ #include "qetmessagebox.h" #include "qfilenameedit.h" +#include #include #include #include @@ -45,7 +46,7 @@ NewElementWizard::NewElementWizard(QWidget *parent, Qt::WindowFlags f) : setWizardStyle(QWizard::MacStyle); #endif - setPixmap(LogoPixmap, QPixmap(":/ico/256x256/qelectrotech.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + setPixmap(LogoPixmap, QIcon::fromTheme("qelectrotech").pixmap(64, 64)); setWindowTitle(tr("Créer un nouvel élément : Assistant", "window title")); setButtonText(QWizard::NextButton, tr("&Suivant >")); addPage(buildStep1());