diff --git a/CMakeLists.txt b/CMakeLists.txt index 39c4cb1..1f00736 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,8 @@ if(NOT BUNDLED_QT_FORK_AWESOME_PATH) else() if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${BUNDLED_QT_FORK_AWESOME_PATH}" OR IS_DIRECTORY "${BUNDLED_QT_FORK_AWESOME_PATH}") add_subdirectory("${BUNDLED_QT_FORK_AWESOME_PATH}" qtforkawesome) - set(qtforkawesome${CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES}_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome") + set(qtforkawesome${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/qtforkawesome") + set(qtforkawesomeiconengine${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/iconengineplugin") else() message(FATAL_ERROR "Specified directory for qtforkawesome sources \"${BUNDLED_QT_FORK_AWESOME_PATH}\" does not exist.") endif() diff --git a/plasmoid/lib/syncthingapplet.cpp b/plasmoid/lib/syncthingapplet.cpp index 176c756..77f6f00 100644 --- a/plasmoid/lib/syncthingapplet.cpp +++ b/plasmoid/lib/syncthingapplet.cpp @@ -264,11 +264,11 @@ void SyncthingApplet::updateStatusIconAndTooltip() emit connectionStatusChanged(); } -QIcon SyncthingApplet::loadForkAwesomeIcon(const QString &name) const +QIcon SyncthingApplet::loadForkAwesomeIcon(const QString &name, int size) const { const auto icon = QtForkAwesome::iconFromId(name); return QtForkAwesome::isIconValid(icon) - ? QIcon(IconManager::instance().forkAwesomeRenderer().pixmap(icon, QSize(32, 32), QGuiApplication::palette().color(QPalette::WindowText))) + ? QIcon(IconManager::instance().forkAwesomeRenderer().pixmap(icon, QSize(size, size), QGuiApplication::palette().color(QPalette::WindowText))) : QIcon(); } diff --git a/plasmoid/lib/syncthingapplet.h b/plasmoid/lib/syncthingapplet.h index c4c6cac..25bada1 100644 --- a/plasmoid/lib/syncthingapplet.h +++ b/plasmoid/lib/syncthingapplet.h @@ -119,7 +119,7 @@ public Q_SLOTS: void showDirectoryErrors(unsigned int directoryIndex); void copyToClipboard(const QString &text); void updateStatusIconAndTooltip(); - QIcon loadForkAwesomeIcon(const QString &name) const; + QIcon loadForkAwesomeIcon(const QString &name, int size = 32) const; QString formatFileSize(quint64 fileSizeInByte) const; Q_SIGNALS: diff --git a/plasmoid/package/contents/ui/FullRepresentation.qml b/plasmoid/package/contents/ui/FullRepresentation.qml index d54f400..b2c9b5a 100644 --- a/plasmoid/package/contents/ui/FullRepresentation.qml +++ b/plasmoid/package/contents/ui/FullRepresentation.qml @@ -357,7 +357,13 @@ ColumnLayout { } PlasmaComponents3.ToolButton { id: showOwnIdButton - icon.name: "view-barcode" + // use PlasmaCore.IconItem for the icon because I wouldn't know how to show the QIcon otherwise + contentItem: PlasmaCore.IconItem { + source: plasmoid.nativeInterface.loadForkAwesomeIcon("qrcode", 64) + } + // set preferred size so the tool button is displayed consistently with the previous one despite using PlasmaCore.IconItem + Layout.preferredWidth: settingsButton.width + Layout.preferredHeight: settingsButton.height onClicked: { plasmoid.nativeInterface.showOwnDeviceId() plasmoid.expanded = false diff --git a/tray/CMakeLists.txt b/tray/CMakeLists.txt index af7f1eb..e52d725 100644 --- a/tray/CMakeLists.txt +++ b/tray/CMakeLists.txt @@ -112,6 +112,13 @@ use_syncthingmodel() find_package(syncthingwidgets ${META_APP_VERSION} REQUIRED) use_syncthingwidgets() +# link against the qtforkawesomeiconengine plugin when static linkage is enabled +include(3rdParty) +if (STATIC_LINKAGE) + find_package(qtforkawesomeiconengine${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME} 0.0.1 REQUIRED) + use_qt_fork_awesome_icon_engine() +endif () + # link also explicitly against the following Qt modules list(APPEND ADDITIONAL_QT_MODULES Network) diff --git a/tray/gui/traywidget.cpp b/tray/gui/traywidget.cpp index 678c55a..95b91e2 100644 --- a/tray/gui/traywidget.cpp +++ b/tray/gui/traywidget.cpp @@ -116,8 +116,7 @@ TrayWidget::TrayWidget(TrayMenu *parent) m_cornerFrame->setLayout(cornerFrameLayout); auto *viewIdButton = new QPushButton(m_cornerFrame); viewIdButton->setToolTip(tr("View own device ID")); - viewIdButton->setIcon( - QIcon::fromTheme(QStringLiteral("view-barcode"), QIcon(QStringLiteral(":/icons/hicolor/scalable/actions/view-barcode.svg")))); + viewIdButton->setIcon(QIcon(QStringLiteral("qrcode.fa"))); viewIdButton->setFlat(true); cornerFrameLayout->addWidget(viewIdButton); auto *restartButton = new QPushButton(m_cornerFrame);