Loaded the traced icons by theme name and removed the PNGs they replace

This commit is contained in:
Jeff Patterson
2026-10-01 05:39:46 -05:00
parent 5057817b6e
commit 194708c0da
91 changed files with 39 additions and 133 deletions
@@ -32,6 +32,13 @@ void ElementPreviewDelegate::initStyleOption(QStyleOptionViewItem *option,
const QModelIndex &index) const
{
QStyledItemDelegate::initStyleOption(option, index);
// The view's icon size is set for the element previews. A theme icon
// (a folder, a collection root) would scale up to fill it, so those
// stay at 16 px.
if (!option->icon.name().isEmpty())
option->decorationSize = QSize(16, 16);
if (option->icon.isNull() || !QET::Palette::isDark(option->palette))
return;
@@ -370,8 +370,7 @@
<string>phase</string>
</property>
<property name="icon">
<iconset theme="phase" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/16x16/phase.png</normaloff>:/ico/16x16/phase.png</iconset>
<iconset theme="phase"/>
</property>
</widget>
</item>
@@ -397,8 +396,7 @@
<string>neutre</string>
</property>
<property name="icon">
<iconset theme="neutral" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/16x16/neutral.png</normaloff>:/ico/16x16/neutral.png</iconset>
<iconset theme="neutral"/>
</property>
</widget>
</item>
@@ -433,8 +431,7 @@
<string>terre</string>
</property>
<property name="icon">
<iconset theme="ground" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/16x16/ground.png</normaloff>:/ico/16x16/ground.png</iconset>
<iconset theme="ground"/>
</property>
</widget>
</item>
@@ -157,8 +157,7 @@
<string/>
</property>
<property name="icon">
<iconset theme="configure-toolbars" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/16x16/configure-toolbars.png</normaloff>:/ico/16x16/configure-toolbars.png</iconset>
<iconset theme="configure-toolbars"/>
</property>
<property name="checkable">
<bool>true</bool>
+8 -16
View File
@@ -340,8 +340,7 @@
</action>
<action name="m_paste_from_file_action">
<property name="icon">
<iconset theme="text-xml" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/16x16/text-xml.png</normaloff>:/ico/16x16/text-xml.png</iconset>
<iconset theme="text-xml"/>
</property>
<property name="text">
<string>Un fichier</string>
@@ -376,8 +375,7 @@
</action>
<action name="m_edit_names_action">
<property name="icon">
<iconset theme="names" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/22x22/names.png</normaloff>:/ico/22x22/names.png</iconset>
<iconset theme="names"/>
</property>
<property name="text">
<string>Éditer le nom et les traductions de l'élément</string>
@@ -394,8 +392,7 @@
</action>
<action name="m_edit_element_properties_action">
<property name="icon">
<iconset theme="element-edit" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/22x22/element-edit.png</normaloff>:/ico/22x22/element-edit.png</iconset>
<iconset theme="element-edit"/>
</property>
<property name="text">
<string>Éditer les propriétés de l'élément</string>
@@ -421,8 +418,7 @@
</action>
<action name="m_zoom_fit_best_action">
<property name="icon">
<iconset theme="zoom-fit-best" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/22x22/zoom-fit-best.png</normaloff>:/ico/22x22/zoom-fit-best.png</iconset>
<iconset theme="zoom-fit-best"/>
</property>
<property name="text">
<string>Zoom adapté</string>
@@ -430,8 +426,7 @@
</action>
<action name="m_zoom_original_action">
<property name="icon">
<iconset theme="zoom-original" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/22x22/zoom-original.png</normaloff>:/ico/22x22/zoom-original.png</iconset>
<iconset theme="zoom-original"/>
</property>
<property name="text">
<string>Pas de zoom</string>
@@ -499,8 +494,7 @@
</action>
<action name="m_rotate_action">
<property name="icon">
<iconset theme="orientations" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/16x16/orientations.png</normaloff>:/ico/16x16/orientations.png</iconset>
<iconset theme="orientations"/>
</property>
<property name="text">
<string>Rotation</string>
@@ -508,8 +502,7 @@
</action>
<action name="m_rotateFine_action">
<property name="icon">
<iconset theme="orientations" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/16x16/orientations.png</normaloff>:/ico/16x16/orientations.png</iconset>
<iconset theme="orientations"/>
</property>
<property name="text">
<string>Fine-Rotation</string>
@@ -535,8 +528,7 @@
</action>
<action name="m_import_dxf">
<property name="icon">
<iconset theme="run-dxf" resource="../../../qelectrotech.qrc">
<normaloff>:/ico/16x16/run-dxf.png</normaloff>:/ico/16x16/run-dxf.png</iconset>
<iconset theme="run-dxf"/>
</property>
<property name="text">
<string>Importer un dxf</string>
+1 -1
View File
@@ -256,7 +256,7 @@ bool ElementsPanel::matchesFilter(const QTreeWidgetItem *item,
void ElementsPanel::reload()
{
QIcon system_icon(":/ico/16x16/qet.png");
QIcon company_icon(":/ico/16x16/go-company.png");
QIcon company_icon = QET::Icons::Company;
QIcon user_icon(":/ico/16x16/go-home.png");
// load the common title block templates collection
+1 -1
View File
@@ -35,7 +35,7 @@ GenericPanel::GenericPanel(QWidget *parent) :
first_activation_(true)
{
header() -> hide();
setIconSize(QSize(50, 50));
setIconSize(QSize(16, 16));
}
/**
+5 -10
View File
@@ -341,8 +341,7 @@
</action>
<action name="m_landscape_action">
<property name="icon">
<iconset theme="landscape" resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/landscape.png</normaloff>:/ico/22x22/landscape.png</iconset>
<iconset theme="landscape"/>
</property>
<property name="text">
<string>Paysage</string>
@@ -350,8 +349,7 @@
</action>
<action name="m_portrait_action">
<property name="icon">
<iconset theme="portrait" resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/portrait.png</normaloff>:/ico/22x22/portrait.png</iconset>
<iconset theme="portrait"/>
</property>
<property name="text">
<string>Portrait</string>
@@ -359,8 +357,7 @@
</action>
<action name="m_first_page_action">
<property name="icon">
<iconset theme="arrow-left-double" resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/arrow-left-double.png</normaloff>:/ico/16x16/arrow-left-double.png</iconset>
<iconset theme="arrow-left-double"/>
</property>
<property name="text">
<string>Première page</string>
@@ -386,8 +383,7 @@
</action>
<action name="m_last_page_action">
<property name="icon">
<iconset theme="arrow-right-double" resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/arrow-right-double.png</normaloff>:/ico/22x22/arrow-right-double.png</iconset>
<iconset theme="arrow-right-double"/>
</property>
<property name="text">
<string>Dernière page</string>
@@ -413,8 +409,7 @@
</action>
<action name="m_display_all_page_action">
<property name="icon">
<iconset theme="all_pages" resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/all_pages.png</normaloff>:/ico/22x22/all_pages.png</iconset>
<iconset theme="all_pages"/>
</property>
<property name="text">
<string>Afficher un aperçu de toutes les pages</string>
@@ -104,8 +104,7 @@
<string/>
</property>
<property name="icon">
<iconset theme="zoom-fit-best" resource="../../../../qelectrotech.qrc">
<normaloff>:/ico/22x22/zoom-fit-best.png</normaloff>:/ico/22x22/zoom-fit-best.png</iconset>
<iconset theme="zoom-fit-best"/>
</property>
</widget>
</item>
@@ -203,8 +202,7 @@
<string/>
</property>
<property name="icon">
<iconset theme="all_pages" resource="../../../../qelectrotech.qrc">
<normaloff>:/ico/22x22/all_pages.png</normaloff>:/ico/22x22/all_pages.png</iconset>
<iconset theme="all_pages"/>
</property>
</widget>
</item>
+5 -4
View File
@@ -568,10 +568,11 @@ void QET::Icons::initIcons()
// The elements panel shows the project root with this icon in a 50 px
// slot meant for element previews. The theme name "project" also
// carries the 128 px file used by the configuration dialog, and on a
// 2x display Qt's theme loader would pick it and fill the slot. Load
// the two small files directly so the item stays at 16/22 px.
ProjectFileGP.addFile(":/ico/themes/qet/16x16/project.png");
ProjectFileGP.addFile(":/ico/themes/qet/22x22/project.png");
// 2x display Qt's theme loader would pick it and fill the slot. Keep
// only the 16 and 22 px pixmaps so the item stays at that size.
ProjectFileGP = QIcon();
for (int size : {16, 22})
ProjectFileGP.addPixmap(Projects.pixmap(QSize(size, size), 1.0));
QETLogo = QIcon::fromTheme("qet");
QETManual = QIcon::fromTheme("help-contents");
QETLogo.addFile(":/ico/256x256/qet.png");
+3 -6
View File
@@ -363,8 +363,7 @@
<string>neutre</string>
</property>
<property name="icon">
<iconset theme="neutral" resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/neutral.png</normaloff>:/ico/16x16/neutral.png</iconset>
<iconset theme="neutral"/>
</property>
</widget>
</item>
@@ -377,8 +376,7 @@
<string>terre</string>
</property>
<property name="icon">
<iconset theme="ground" resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/ground.png</normaloff>:/ico/16x16/ground.png</iconset>
<iconset theme="ground"/>
</property>
</widget>
</item>
@@ -391,8 +389,7 @@
<string>phase</string>
</property>
<property name="icon">
<iconset theme="phase" resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/phase.png</normaloff>:/ico/16x16/phase.png</iconset>
<iconset theme="phase"/>
</property>
</widget>
</item>
+1 -2
View File
@@ -66,8 +66,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset theme="textfield" resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/textfield.png</normaloff>:/ico/22x22/textfield.png</iconset>
<iconset theme="textfield"/>
</property>
</widget>
</item>
+2 -4
View File
@@ -94,8 +94,7 @@
<string notr="true"/>
</property>
<property name="icon">
<iconset theme="titleblock-bottom" resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/titleblock-bottom.png</normaloff>:/ico/22x22/titleblock-bottom.png</iconset>
<iconset theme="titleblock-bottom"/>
</property>
</item>
<item>
@@ -103,8 +102,7 @@
<string notr="true"/>
</property>
<property name="icon">
<iconset theme="titleblock-right" resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/titleblock-right.png</normaloff>:/ico/22x22/titleblock-right.png</iconset>
<iconset theme="titleblock-right"/>
</property>
</item>
</widget>