From 0e124fe3d29189460d576c777621720e768495cd Mon Sep 17 00:00:00 2001 From: Zhang Yu Date: Mon, 11 Dec 2023 15:15:58 +0800 Subject: [PATCH] fix: Packing icons with the buildin icon rule 1. Packing icons with the buildin icon rule. 2. Using icon theme to get icon. Log: Bug: https://pms.uniontech.com/bug-view-231629.html Bug: https://pms.uniontech.com/bug-view-231637.html --- src/grand-search/CMakeLists.txt | 2 +- .../preview/generalwidget/detailitem.cpp | 25 ++++++++++++----- .../preview/generalwidget/detailitem.h | 1 + .../gui/searchconfig/bestmatchwidget.cpp | 6 +---- .../blacklistview/blacklistdelegate.cpp | 15 +++-------- .../blacklistview/deletedialog.cpp | 2 +- .../gui/searchconfig/blacklistwidget.cpp | 6 ++--- .../gui/searchconfig/configwidget.cpp | 2 +- .../texts/appsearch_36px.svg} | 0 .../texts/audiosearch_36px.svg} | 0 .../texts/bestmatch_36px.svg} | 0 .../texts/documentsearch_36px.svg} | 0 .../texts/experienceplan_36px.svg} | 0 .../texts/filesearch_36px.svg} | 0 .../texts/foldersearch_36px.svg} | 0 .../texts/picturesearch_36px.svg} | 0 .../texts/settingsearch_36px.svg} | 0 .../texts/videosearch_36px.svg} | 0 .../texts/websearch_36px.svg} | 0 .../dde-grand-search-setting_32px.svg} | 0 .../gui/searchconfig/icons/images.qrc | 27 +++++++++++++++++++ .../texts/appsearch_36px.svg} | 0 .../texts/audiosearch_36px.svg} | 0 .../texts/bestmatch_36px.svg} | 0 .../texts/documentsearch_36px.svg} | 0 .../texts/experienceplan_36px.svg} | 0 .../texts/filesearch_36px.svg} | 0 .../texts/foldersearch_36px.svg} | 0 .../texts/picturesearch_36px.svg} | 0 .../texts/settingsearch_36px.svg} | 0 .../texts/videosearch_36px.svg} | 0 .../texts/websearch_36px.svg} | 0 .../gui/searchconfig/planwidget.cpp | 3 +-- .../gui/searchconfig/resource.qrc | 27 ------------------- .../gui/searchconfig/scopewidget.cpp | 7 +---- .../switchwidget/switchwidget.cpp | 1 - 36 files changed, 58 insertions(+), 66 deletions(-) rename src/grand-search/gui/searchconfig/icons/{appsearch-light.svg => dark/texts/appsearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{audiosearch-light.svg => dark/texts/audiosearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{bestmatch-light.svg => dark/texts/bestmatch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{documentsearch-light.svg => dark/texts/documentsearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{experienceplan-light.svg => dark/texts/experienceplan_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{filesearch-light.svg => dark/texts/filesearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{foldersearch-light.svg => dark/texts/foldersearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{picturesearch-light.svg => dark/texts/picturesearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{settingsearch-light.svg => dark/texts/settingsearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{videosearch-light.svg => dark/texts/videosearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{websearch-light.svg => dark/texts/websearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{dde-grand-search-setting.svg => icons/dde-grand-search-setting_32px.svg} (100%) create mode 100644 src/grand-search/gui/searchconfig/icons/images.qrc rename src/grand-search/gui/searchconfig/icons/{appsearch-dark.svg => light/texts/appsearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{audiosearch-dark.svg => light/texts/audiosearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{bestmatch-dark.svg => light/texts/bestmatch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{documentsearch-dark.svg => light/texts/documentsearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{experienceplan-dark.svg => light/texts/experienceplan_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{filesearch-dark.svg => light/texts/filesearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{foldersearch-dark.svg => light/texts/foldersearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{picturesearch-dark.svg => light/texts/picturesearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{settingsearch-dark.svg => light/texts/settingsearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{videosearch-dark.svg => light/texts/videosearch_36px.svg} (100%) rename src/grand-search/gui/searchconfig/icons/{websearch-dark.svg => light/texts/websearch_36px.svg} (100%) delete mode 100644 src/grand-search/gui/searchconfig/resource.qrc diff --git a/src/grand-search/CMakeLists.txt b/src/grand-search/CMakeLists.txt index 2bcf4f77..3d7cef49 100644 --- a/src/grand-search/CMakeLists.txt +++ b/src/grand-search/CMakeLists.txt @@ -194,7 +194,7 @@ set(SRCS # 指定资源文件 set(QRCS - gui/searchconfig/resource.qrc + gui/searchconfig/icons/images.qrc gui/exhibition/preview/resource.qrc gui/exhibition/matchresult/resource.qrc ) diff --git a/src/grand-search/gui/exhibition/preview/generalwidget/detailitem.cpp b/src/grand-search/gui/exhibition/preview/generalwidget/detailitem.cpp index c25897cf..c1265efd 100644 --- a/src/grand-search/gui/exhibition/preview/generalwidget/detailitem.cpp +++ b/src/grand-search/gui/exhibition/preview/generalwidget/detailitem.cpp @@ -21,13 +21,9 @@ DetailItem::DetailItem(QWidget *parent) : QWidget(parent) { setFixedSize(360, 36); - - m_backgroundColor = QColor(0, 0, 0, int(255*0.05)); - setContentsMargins(20, 0, 10, 0); m_radius = 8; - m_tagLabel = new DLabel(this); m_tagLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); @@ -150,7 +146,10 @@ void DetailItem::paintEvent(QPaintEvent *event) { QPainter p(this); p.setPen(Qt::NoPen); - p.setBrush(m_backgroundColor); + if (m_backgroundColor.isValid()) + p.setBrush(m_backgroundColor); + else + p.setBrush(getDefalutBackground()); QRect roundRect(0, 0, m_radius * 2, m_radius * 2); QPainterPath path; @@ -195,7 +194,7 @@ void DetailItem::paintEvent(QPaintEvent *event) QColor DetailItem::getTagColor() { - static QColor tagTextColor; + static QColor tagTextColor; if (!tagTextColor.isValid()) { tagTextColor = QColor(0, 0, 0, int(255*0.7)); if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType) @@ -206,7 +205,7 @@ QColor DetailItem::getTagColor() QColor DetailItem::getContentColor() { - static QColor contentTextColor; + static QColor contentTextColor; if (!contentTextColor.isValid()) { contentTextColor = QColor(0, 0, 0, int(255*0.9)); if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType) @@ -214,3 +213,15 @@ QColor DetailItem::getContentColor() } return contentTextColor; } + +QColor DetailItem::getDefalutBackground() +{ + static QColor bkgColor; + if (!bkgColor.isValid()) { + if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::DarkType) + bkgColor = QColor(255, 255, 255, int(255 * 0.05)); + else + bkgColor = QColor(0, 0, 0, int(255 * 0.05)); + } + return bkgColor; +} diff --git a/src/grand-search/gui/exhibition/preview/generalwidget/detailitem.h b/src/grand-search/gui/exhibition/preview/generalwidget/detailitem.h index 45d5493e..99f69163 100644 --- a/src/grand-search/gui/exhibition/preview/generalwidget/detailitem.h +++ b/src/grand-search/gui/exhibition/preview/generalwidget/detailitem.h @@ -48,6 +48,7 @@ class DetailItem : public QWidget private: QColor getTagColor(); QColor getContentColor(); + QColor getDefalutBackground(); protected: bool m_topRound = false; bool m_bottomRound = false; diff --git a/src/grand-search/gui/searchconfig/bestmatchwidget.cpp b/src/grand-search/gui/searchconfig/bestmatchwidget.cpp index 37606ebb..39c2108c 100644 --- a/src/grand-search/gui/searchconfig/bestmatchwidget.cpp +++ b/src/grand-search/gui/searchconfig/bestmatchwidget.cpp @@ -79,12 +79,8 @@ void BestMatchWidget::updateIcons() { Q_ASSERT(m_switchWidgets.count() == m_displayIcons.count()); - QString suffix = Utils::iconThemeSuffix(); - for (int i = 0; i < m_switchWidgets.count(); ++i) { - - QString iconName = m_displayIcons.at(i); - QIcon icon = QIcon(QString(":/icons/%1%2.svg").arg(iconName).arg(suffix)); + QIcon icon = QIcon::fromTheme(m_displayIcons.at(i)); auto switchWidget = m_switchWidgets.at(i); Q_ASSERT(switchWidget); diff --git a/src/grand-search/gui/searchconfig/blacklistview/blacklistdelegate.cpp b/src/grand-search/gui/searchconfig/blacklistview/blacklistdelegate.cpp index 593748af..505b6c7d 100644 --- a/src/grand-search/gui/searchconfig/blacklistview/blacklistdelegate.cpp +++ b/src/grand-search/gui/searchconfig/blacklistview/blacklistdelegate.cpp @@ -62,18 +62,9 @@ void BlackListDelegate::drawPathsText(QPainter *painter, const QStyleOptionViewI QFontMetrics pathFontMetrics(pathFont); QString elidedPath = pathFontMetrics.elidedText(path, Qt::ElideMiddle, ListTextMaxWidth); - const BlackListView *listView = qobject_cast(option.widget); - auto selected = listView->selectionModel(); - QColor pathColor; - if (selected->isSelected(index)) { - pathColor = QColor("#FFFFFF"); - } else { - if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) { - pathColor = QColor("#414D68"); - } else { - pathColor = QColor("#C0C6D4"); - } - } + QBrush pathColor = option.state & QStyle::State_Selected + ? option.palette.highlightedText() + : option.palette.text(); QTextDocument pathDocument; pathDocument.setDocumentMargin(0); diff --git a/src/grand-search/gui/searchconfig/blacklistview/deletedialog.cpp b/src/grand-search/gui/searchconfig/blacklistview/deletedialog.cpp index 05408bf9..1e304c31 100644 --- a/src/grand-search/gui/searchconfig/blacklistview/deletedialog.cpp +++ b/src/grand-search/gui/searchconfig/blacklistview/deletedialog.cpp @@ -13,7 +13,7 @@ DeleteDialog::DeleteDialog(QWidget *parent) { const QString content(tr("Do you want to remove the path from the exclusion list?")); setMessage(content); - setIcon(QIcon(QString(":/icons/%1.svg").arg("dde-grand-search-setting"))); + setIcon(QIcon::fromTheme("dde-grand-search-setting")); // the cancel button { diff --git a/src/grand-search/gui/searchconfig/blacklistwidget.cpp b/src/grand-search/gui/searchconfig/blacklistwidget.cpp index 91b7f126..860ae06a 100644 --- a/src/grand-search/gui/searchconfig/blacklistwidget.cpp +++ b/src/grand-search/gui/searchconfig/blacklistwidget.cpp @@ -38,9 +38,9 @@ BlackListWidget::BlackListWidget(QWidget *parent) m_contentLabel->setWordWrap(true); DFontSizeManager::instance()->bind(m_contentLabel, DFontSizeManager::T8); - QPalette p(m_contentLabel->palette()); - p.setColor(QPalette::Active, QPalette::WindowText, QColor("#526A7F")); - m_contentLabel->setPalette(p); +// QPalette p(m_contentLabel->palette()); +// p.setColor(QPalette::Active, QPalette::WindowText, QColor("#526A7F")); +// m_contentLabel->setPalette(p); m_childHLayout->addStretch(); diff --git a/src/grand-search/gui/searchconfig/configwidget.cpp b/src/grand-search/gui/searchconfig/configwidget.cpp index 7c0ce0c3..00b031a6 100644 --- a/src/grand-search/gui/searchconfig/configwidget.cpp +++ b/src/grand-search/gui/searchconfig/configwidget.cpp @@ -45,7 +45,7 @@ void ConfigWidget::initUI() this->titlebar()->setMenuVisible(false); // 设置图标 - QIcon tmpIcon = QIcon(QString(":/icons/%1.svg").arg("dde-grand-search-setting")); + QIcon tmpIcon = QIcon::fromTheme("dde-grand-search-setting"); this->titlebar()->setIcon(tmpIcon); setWindowIcon(tmpIcon); diff --git a/src/grand-search/gui/searchconfig/icons/appsearch-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/appsearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/appsearch-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/appsearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/audiosearch-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/audiosearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/audiosearch-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/audiosearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/bestmatch-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/bestmatch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/bestmatch-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/bestmatch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/documentsearch-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/documentsearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/documentsearch-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/documentsearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/experienceplan-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/experienceplan_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/experienceplan-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/experienceplan_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/filesearch-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/filesearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/filesearch-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/filesearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/foldersearch-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/foldersearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/foldersearch-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/foldersearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/picturesearch-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/picturesearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/picturesearch-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/picturesearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/settingsearch-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/settingsearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/settingsearch-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/settingsearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/videosearch-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/videosearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/videosearch-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/videosearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/websearch-light.svg b/src/grand-search/gui/searchconfig/icons/dark/texts/websearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/websearch-light.svg rename to src/grand-search/gui/searchconfig/icons/dark/texts/websearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/dde-grand-search-setting.svg b/src/grand-search/gui/searchconfig/icons/icons/dde-grand-search-setting_32px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/dde-grand-search-setting.svg rename to src/grand-search/gui/searchconfig/icons/icons/dde-grand-search-setting_32px.svg diff --git a/src/grand-search/gui/searchconfig/icons/images.qrc b/src/grand-search/gui/searchconfig/icons/images.qrc new file mode 100644 index 00000000..a4582679 --- /dev/null +++ b/src/grand-search/gui/searchconfig/icons/images.qrc @@ -0,0 +1,27 @@ + + + dark/texts/appsearch_36px.svg + dark/texts/documentsearch_36px.svg + dark/texts/foldersearch_36px.svg + dark/texts/videosearch_36px.svg + dark/texts/audiosearch_36px.svg + dark/texts/experienceplan_36px.svg + dark/texts/picturesearch_36px.svg + dark/texts/bestmatch_36px.svg + dark/texts/filesearch_36px.svg + dark/texts/settingsearch_36px.svg + dark/texts/websearch_36px.svg + light/texts/appsearch_36px.svg + light/texts/documentsearch_36px.svg + light/texts/foldersearch_36px.svg + light/texts/videosearch_36px.svg + light/texts/audiosearch_36px.svg + light/texts/experienceplan_36px.svg + light/texts/picturesearch_36px.svg + light/texts/bestmatch_36px.svg + light/texts/filesearch_36px.svg + light/texts/settingsearch_36px.svg + light/texts/websearch_36px.svg + icons/dde-grand-search-setting_32px.svg + + diff --git a/src/grand-search/gui/searchconfig/icons/appsearch-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/appsearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/appsearch-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/appsearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/audiosearch-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/audiosearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/audiosearch-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/audiosearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/bestmatch-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/bestmatch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/bestmatch-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/bestmatch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/documentsearch-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/documentsearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/documentsearch-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/documentsearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/experienceplan-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/experienceplan_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/experienceplan-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/experienceplan_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/filesearch-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/filesearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/filesearch-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/filesearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/foldersearch-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/foldersearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/foldersearch-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/foldersearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/picturesearch-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/picturesearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/picturesearch-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/picturesearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/settingsearch-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/settingsearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/settingsearch-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/settingsearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/videosearch-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/videosearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/videosearch-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/videosearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/icons/websearch-dark.svg b/src/grand-search/gui/searchconfig/icons/light/texts/websearch_36px.svg similarity index 100% rename from src/grand-search/gui/searchconfig/icons/websearch-dark.svg rename to src/grand-search/gui/searchconfig/icons/light/texts/websearch_36px.svg diff --git a/src/grand-search/gui/searchconfig/planwidget.cpp b/src/grand-search/gui/searchconfig/planwidget.cpp index 21818137..0bd33fe6 100644 --- a/src/grand-search/gui/searchconfig/planwidget.cpp +++ b/src/grand-search/gui/searchconfig/planwidget.cpp @@ -100,8 +100,7 @@ void PlanWidget::onSwitchStateChanged(const bool checked) void PlanWidget::updateIcons() { - QString suffix = Utils::iconThemeSuffix(); - QIcon icon = QIcon(QString(":/icons/%1%2.svg").arg(m_displayIcon).arg(suffix)); + QIcon icon = QIcon::fromTheme(m_displayIcon); m_switchWidget->setIcon(icon, QSize(SWITCHWIDGETICONSIZE, SWITCHWIDGETICONSIZE)); update(); diff --git a/src/grand-search/gui/searchconfig/resource.qrc b/src/grand-search/gui/searchconfig/resource.qrc deleted file mode 100644 index b708894c..00000000 --- a/src/grand-search/gui/searchconfig/resource.qrc +++ /dev/null @@ -1,27 +0,0 @@ - - - icons/dde-grand-search-setting.svg - icons/appsearch-dark.svg - icons/appsearch-light.svg - icons/audiosearch-dark.svg - icons/audiosearch-light.svg - icons/documentsearch-dark.svg - icons/documentsearch-light.svg - icons/experienceplan-dark.svg - icons/experienceplan-light.svg - icons/filesearch-dark.svg - icons/filesearch-light.svg - icons/foldersearch-dark.svg - icons/foldersearch-light.svg - icons/picturesearch-dark.svg - icons/picturesearch-light.svg - icons/settingsearch-dark.svg - icons/settingsearch-light.svg - icons/videosearch-dark.svg - icons/videosearch-light.svg - icons/websearch-dark.svg - icons/websearch-light.svg - icons/bestmatch-dark.svg - icons/bestmatch-light.svg - - diff --git a/src/grand-search/gui/searchconfig/scopewidget.cpp b/src/grand-search/gui/searchconfig/scopewidget.cpp index 3d981db9..bc162615 100644 --- a/src/grand-search/gui/searchconfig/scopewidget.cpp +++ b/src/grand-search/gui/searchconfig/scopewidget.cpp @@ -104,13 +104,8 @@ void ScopeWidget::updateIcons() { Q_ASSERT(m_switchWidgets.count() == m_displayIcons.count()); - QString suffix = Utils::iconThemeSuffix(); - for (int i = 0; i < m_switchWidgets.count(); ++i) { - - QString iconName = m_displayIcons.at(i); - QIcon icon = QIcon(QString(":/icons/%1%2.svg").arg(iconName).arg(suffix)); - + QIcon icon = QIcon::fromTheme(m_displayIcons.at(i)); auto switchWidget = m_switchWidgets.at(i); Q_ASSERT(switchWidget); diff --git a/src/grand-search/gui/searchconfig/switchwidget/switchwidget.cpp b/src/grand-search/gui/searchconfig/switchwidget/switchwidget.cpp index ba0efbfa..cbf4bbe3 100644 --- a/src/grand-search/gui/searchconfig/switchwidget/switchwidget.cpp +++ b/src/grand-search/gui/searchconfig/switchwidget/switchwidget.cpp @@ -25,7 +25,6 @@ SwitchWidget::SwitchWidget(QWidget *parent, QWidget *leftWidget) : QWidget (parent) , m_leftWidget(leftWidget) { - m_iconLabel = new QLabel(this); m_iconLabel->setFixedSize(ICONLABELSIZE, ICONLABELSIZE);