Migrate to ForkAwesome

* FontAwesome uses a propritary build system so let's move to its fork
  ForkAwesome similar to Syncthing
    * See https://github.com/syncthing/syncthing/pull/5237
* Bundle the font file instead of having the SVGs directly within
  Syncthing Tray's own repository
This commit is contained in:
Martchus 2021-09-11 02:20:38 +02:00
parent ac6ee45017
commit 43fcb9f71b
38 changed files with 121 additions and 131 deletions

View File

@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
# define metadata
set(META_PROJECT_NAME syncthingtray)
set(META_PROJECT_TYPE application)
set(META_APP_AUTHOR "Martchus")
set(META_APP_AUTHOR_MAIL "martchus@gmx.net")
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
@ -11,7 +10,7 @@ set(META_APP_CATEGORIES "Network;FileTransfer")
set(META_GUI_OPTIONAL false)
set(META_VERSION_MAJOR 1)
set(META_VERSION_MINOR 1)
set(META_VERSION_PATCH 10)
set(META_VERSION_PATCH 11)
set(META_VERSION_EXACT_SONAME ON)
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
@ -42,6 +41,30 @@ option(NO_PLASMOID "whether building the Plasma 5 plasmoid should be skipped" "$
set(CONFIGURATION_PACKAGE_SUFFIX "" CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
set(CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES "${CONFIGURATION_PACKAGE_SUFFIX}" CACHE STRING "sets the suffix for qtutilities")
# allow building qtforkawesome as part of this project
set(BUNDLED_QT_FORK_AWESOME_PATH OFF CACHE PATH "specifies the (relative) path to the qtforkawesome sources for building it together with ${META_PROJECT_NAME}")
if(NOT BUNDLED_QT_FORK_AWESOME_PATH)
message(STATUS "Using system qtforkawesome")
else()
# check whether bundled c++utilities actually exists
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${BUNDLED_QT_FORK_AWESOME_PATH}")
# treat the specified path as relative to the current source dir
set(qtforkawesome_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${BUNDLED_QT_FORK_AWESOME_PATH}")
elseif(IS_DIRECTORY "${BUNDLED_QT_FORK_AWESOME_PATH}")
# treat the specified path as absolute
set(qtforkawesome_DIR "${BUNDLED_QT_FORK_AWESOME_PATH}")
else()
# consider the specified path invalid
set(qtforkawesome_DIR "")
endif()
if(qtforkawesome_DIR)
add_subdirectory("${BUNDLED_QT_FORK_AWESOME_PATH}" qtforkawesome_DIR)
list(APPEND CMAKE_MODULE_PATH "${CPP_UTILITIES_SOURCE_DIR}/cmake/modules")
else()
message(FATAL_ERROR "Specified directory for qtforkawesome sources \"${BUNDLED_CPP_UTILITIES_PATH}\" does not exist.")
endif()
endif()
# add subdirectories
enable_testing()
add_subdirectory(connector)

View File

@ -244,8 +244,9 @@ See the release section on GitHub.
by [perfect7gentleman's repository](https://github.com/perfect7gentleman/pg_overlay)
## Build instructions
The application depends on [c++utilities](https://github.com/Martchus/cpp-utilities) and
[qtutilities](https://github.com/Martchus/qtutilities) and is built the same way as these libraries.
The application depends on [c++utilities](https://github.com/Martchus/cpp-utilities),
[qtutilities](https://github.com/Martchus/qtutilities) and
[qtforkawesome](https://github.com/Martchus/qtforkawesome) and is built the same way as these libraries.
For basic instructions checkout the README file of [c++utilities](https://github.com/Martchus/cpp-utilities).
For building this straight, see the section below. There's also documentation about
[various build variables](https://github.com/Martchus/cpp-utilities/blob/master/doc/buildvariables.md) which
@ -298,6 +299,8 @@ Building the testsuite requires CppUnit and Qt 5.8 or higher.
cd $SOURCES
git clone -c core.symlinks=true https://github.com/Martchus/cpp-utilities.git c++utilities
git clone -c core.symlinks=true https://github.com/Martchus/qtutilities.git
git clone -c core.symlinks=true https://github.com/Martchus/qtforkawesome.git
git clone -c core.symlinks=true https://github.com/ForkAwesome/Fork-Awesome.git forkawesome
git clone -c core.symlinks=true https://github.com/Martchus/syncthingtray.git
git clone -c core.symlinks=true https://github.com/Martchus/subdirs.git
```
@ -311,6 +314,9 @@ Building the testsuite requires CppUnit and Qt 5.8 or higher.
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/install/prefix" \
-DBUNDLED_QT_FORK_AWESOME_PATH="$SOURCES/qtforkawesome" \
-DFORK_AWESOME_FONT_FILE="$SOURCES/forkawesome/fonts/forkawesome-webfont.woff2" \
-DFORK_AWESOME_ICON_DEFINITIONS="$SOURCES/forkawesome/src/icons/icons.yml" \
$SOURCES/subdirs/syncthingtray
```
* Replace `/install/prefix` with the directory where you want to install.

View File

@ -12,7 +12,7 @@ SyncthingDirActions::SyncthingDirActions(const SyncthingDir &dir, const Syncthin
: QObject(parent)
, m_dirId(dir.id)
{
const auto &icons = !data || !data->isUsingBrightCustomColors() ? fontAwesomeIconsForLightTheme() : fontAwesomeIconsForDarkTheme();
const auto &icons = !data || !data->isUsingBrightCustomColors() ? forkAwesomeIconsForLightTheme() : forkAwesomeIconsForDarkTheme();
m_infoAction.setSeparator(true);
m_infoAction.setIcon(icons.folder);
m_globalStatusAction.setIcon(icons.globe);

View File

@ -105,8 +105,8 @@ void SyncthingFileItemActionStaticData::showAboutDialog()
{
auto *const aboutDialog = new AboutDialog(nullptr, QStringLiteral(APP_NAME),
QStringLiteral(APP_AUTHOR "<br>Syncthing icons from <a href=\"https://syncthing.net\">Syncthing project</a><br>Using "
"icons from <a href=\"https://fontawesome.com\">Font "
"Awesome</a> (see <a href=\"https://fontawesome.com/license\">their license</a>)"),
"icons from <a href=\"https://forkaweso.me\">Fork "
"Awesome</a> (see <a href=\"https://forkaweso.me/Fork-Awesome/license\">their license</a>)"),
QStringLiteral(APP_VERSION), CppUtilities::applicationInfo.dependencyVersions, QStringLiteral(APP_URL), QStringLiteral(APP_DESCRIPTION),
renderSvgImage(makeSyncthingIcon(), QSize(128, 128)).toImage());
aboutDialog->setWindowTitle(tr("About") + QStringLiteral(" - " APP_NAME));

View File

@ -47,6 +47,10 @@ use_qt_utilities()
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
use_syncthingconnector(VISIBILITY PUBLIC)
# find qtforkawesome
find_package(qtforkawesome 0.0.1 REQUIRED)
use_qt_fork_awesome(VISIBILITY PUBLIC)
# link also explicitly against the following Qt modules
list(APPEND ADDITIONAL_QT_MODULES Network Gui Widgets Svg)

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z"/></svg>

Before

Width:  |  Height:  |  Size: 304 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 128H272l-54.63-54.63c-6-6-14.14-9.37-22.63-9.37H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48zm0 272H48V112h140.12l54.63 54.63c6 6 14.14 9.37 22.63 9.37H464v224z"/></svg>

Before

Width:  |  Height:  |  Size: 307 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M567.403 235.642L462.323 84.589A48 48 0 0 0 422.919 64H153.081a48 48 0 0 0-39.404 20.589L8.597 235.642A48.001 48.001 0 0 0 0 263.054V400c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V263.054c0-9.801-3-19.366-8.597-27.412zM153.081 112h269.838l77.913 112H75.168l77.913-112zM528 400H48V272h480v128zm-32-64c0 17.673-14.327 32-32 32s-32-14.327-32-32 14.327-32 32-32 32 14.327 32 32zm-96 0c0 17.673-14.327 32-32 32s-32-14.327-32-32 14.327-32 32-32 32 14.327 32 32z"/></svg>

Before

Width:  |  Height:  |  Size: 542 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M458.622 255.92l45.985-45.005c13.708-12.977 7.316-36.039-10.664-40.339l-62.65-15.99 17.661-62.015c4.991-17.838-11.829-34.663-29.661-29.671l-61.994 17.667-15.984-62.671C337.085.197 313.765-6.276 300.99 7.228L256 53.57 211.011 7.229c-12.63-13.351-36.047-7.234-40.325 10.668l-15.984 62.671-61.995-17.667C74.87 57.907 58.056 74.738 63.046 92.572l17.661 62.015-62.65 15.99C.069 174.878-6.31 197.944 7.392 210.915l45.985 45.005-45.985 45.004c-13.708 12.977-7.316 36.039 10.664 40.339l62.65 15.99-17.661 62.015c-4.991 17.838 11.829 34.663 29.661 29.671l61.994-17.667 15.984 62.671c4.439 18.575 27.696 24.018 40.325 10.668L256 458.61l44.989 46.001c12.5 13.488 35.987 7.486 40.325-10.668l15.984-62.671 61.994 17.667c17.836 4.994 34.651-11.837 29.661-29.671l-17.661-62.015 62.65-15.99c17.987-4.302 24.366-27.367 10.664-40.339l-45.984-45.004z"/></svg>

Before

Width:  |  Height:  |  Size: 911 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm57.1 350.1L224.9 294c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h48c6.6 0 12 5.4 12 12v137.7l63.5 46.2c5.4 3.9 6.5 11.4 2.6 16.8l-28.2 38.8c-3.9 5.3-11.4 6.5-16.8 2.6z"/></svg>

Before

Width:  |  Height:  |  Size: 321 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zm-132.9 88.7L299.3 420.7c-6.2 6.2-16.4 6.2-22.6 0L171.3 315.3c-10.1-10.1-2.9-27.3 11.3-27.3H248V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v112h65.4c14.2 0 21.4 17.2 11.3 27.3z"/></svg>

Before

Width:  |  Height:  |  Size: 511 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z"/></svg>

Before

Width:  |  Height:  |  Size: 511 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M512.1 191l-8.2 14.3c-3 5.3-9.4 7.5-15.1 5.4-11.8-4.4-22.6-10.7-32.1-18.6-4.6-3.8-5.8-10.5-2.8-15.7l8.2-14.3c-6.9-8-12.3-17.3-15.9-27.4h-16.5c-6 0-11.2-4.3-12.2-10.3-2-12-2.1-24.6 0-37.1 1-6 6.2-10.4 12.2-10.4h16.5c3.6-10.1 9-19.4 15.9-27.4l-8.2-14.3c-3-5.2-1.9-11.9 2.8-15.7 9.5-7.9 20.4-14.2 32.1-18.6 5.7-2.1 12.1.1 15.1 5.4l8.2 14.3c10.5-1.9 21.2-1.9 31.7 0L552 6.3c3-5.3 9.4-7.5 15.1-5.4 11.8 4.4 22.6 10.7 32.1 18.6 4.6 3.8 5.8 10.5 2.8 15.7l-8.2 14.3c6.9 8 12.3 17.3 15.9 27.4h16.5c6 0 11.2 4.3 12.2 10.3 2 12 2.1 24.6 0 37.1-1 6-6.2 10.4-12.2 10.4h-16.5c-3.6 10.1-9 19.4-15.9 27.4l8.2 14.3c3 5.2 1.9 11.9-2.8 15.7-9.5 7.9-20.4 14.2-32.1 18.6-5.7 2.1-12.1-.1-15.1-5.4l-8.2-14.3c-10.4 1.9-21.2 1.9-31.7 0zm-10.5-58.8c38.5 29.6 82.4-14.3 52.8-52.8-38.5-29.7-82.4 14.3-52.8 52.8zM386.3 286.1l33.7 16.8c10.1 5.8 14.5 18.1 10.5 29.1-8.9 24.2-26.4 46.4-42.6 65.8-7.4 8.9-20.2 11.1-30.3 5.3l-29.1-16.8c-16 13.7-34.6 24.6-54.9 31.7v33.6c0 11.6-8.3 21.6-19.7 23.6-24.6 4.2-50.4 4.4-75.9 0-11.5-2-20-11.9-20-23.6V418c-20.3-7.2-38.9-18-54.9-31.7L74 403c-10 5.8-22.9 3.6-30.3-5.3-16.2-19.4-33.3-41.6-42.2-65.7-4-10.9.4-23.2 10.5-29.1l33.3-16.8c-3.9-20.9-3.9-42.4 0-63.4L12 205.8c-10.1-5.8-14.6-18.1-10.5-29 8.9-24.2 26-46.4 42.2-65.8 7.4-8.9 20.2-11.1 30.3-5.3l29.1 16.8c16-13.7 34.6-24.6 54.9-31.7V57.1c0-11.5 8.2-21.5 19.6-23.5 24.6-4.2 50.5-4.4 76-.1 11.5 2 20 11.9 20 23.6v33.6c20.3 7.2 38.9 18 54.9 31.7l29.1-16.8c10-5.8 22.9-3.6 30.3 5.3 16.2 19.4 33.2 41.6 42.1 65.8 4 10.9.1 23.2-10 29.1l-33.7 16.8c3.9 21 3.9 42.5 0 63.5zm-117.6 21.1c59.2-77-28.7-164.9-105.7-105.7-59.2 77 28.7 164.9 105.7 105.7zm243.4 182.7l-8.2 14.3c-3 5.3-9.4 7.5-15.1 5.4-11.8-4.4-22.6-10.7-32.1-18.6-4.6-3.8-5.8-10.5-2.8-15.7l8.2-14.3c-6.9-8-12.3-17.3-15.9-27.4h-16.5c-6 0-11.2-4.3-12.2-10.3-2-12-2.1-24.6 0-37.1 1-6 6.2-10.4 12.2-10.4h16.5c3.6-10.1 9-19.4 15.9-27.4l-8.2-14.3c-3-5.2-1.9-11.9 2.8-15.7 9.5-7.9 20.4-14.2 32.1-18.6 5.7-2.1 12.1.1 15.1 5.4l8.2 14.3c10.5-1.9 21.2-1.9 31.7 0l8.2-14.3c3-5.3 9.4-7.5 15.1-5.4 11.8 4.4 22.6 10.7 32.1 18.6 4.6 3.8 5.8 10.5 2.8 15.7l-8.2 14.3c6.9 8 12.3 17.3 15.9 27.4h16.5c6 0 11.2 4.3 12.2 10.3 2 12 2.1 24.6 0 37.1-1 6-6.2 10.4-12.2 10.4h-16.5c-3.6 10.1-9 19.4-15.9 27.4l8.2 14.3c3 5.2 1.9 11.9-2.8 15.7-9.5 7.9-20.4 14.2-32.1 18.6-5.7 2.1-12.1-.1-15.1-5.4l-8.2-14.3c-10.4 1.9-21.2 1.9-31.7 0zM501.6 431c38.5 29.6 82.4-14.3 52.8-52.8-38.5-29.6-82.4 14.3-52.8 52.8z"/></svg>

Before

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M0 168v-16c0-13.255 10.745-24 24-24h360V80c0-21.367 25.899-32.042 40.971-16.971l80 80c9.372 9.373 9.372 24.569 0 33.941l-80 80C409.956 271.982 384 261.456 384 240v-48H24c-13.255 0-24-10.745-24-24zm488 152H128v-48c0-21.314-25.862-32.08-40.971-16.971l-80 80c-9.372 9.373-9.372 24.569 0 33.941l80 80C102.057 463.997 128 453.437 128 432v-48h360c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24z"/></svg>

Before

Width:  |  Height:  |  Size: 475 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/></svg>

Before

Width:  |  Height:  |  Size: 528 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"/></svg>

Before

Width:  |  Height:  |  Size: 410 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M377 105L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zM128.4 336c-17.9 0-32.4 12.1-32.4 27 0 15 14.6 27 32.5 27s32.4-12.1 32.4-27-14.6-27-32.5-27zM224 136V0h-63.6v32h-32V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zM95.9 32h32v32h-32zm32.3 384c-33.2 0-58-30.4-51.4-62.9L96.4 256v-32h32v-32h-32v-32h32v-32h-32V96h32V64h32v32h-32v32h32v32h-32v32h32v32h-32v32h22.1c5.7 0 10.7 4.1 11.8 9.7l17.3 87.7c6.4 32.4-18.4 62.6-51.4 62.6z"/></svg>

Before

Width:  |  Height:  |  Size: 587 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"/></svg>

Before

Width:  |  Height:  |  Size: 402 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"/></svg>

Before

Width:  |  Height:  |  Size: 207 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"/></svg>

Before

Width:  |  Height:  |  Size: 818 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M440.667 182.109l7.143-40c1.313-7.355-4.342-14.109-11.813-14.109h-74.81l14.623-81.891C377.123 38.754 371.468 32 363.997 32h-40.632a12 12 0 0 0-11.813 9.891L296.175 128H197.54l14.623-81.891C213.477 38.754 207.822 32 200.35 32h-40.632a12 12 0 0 0-11.813 9.891L132.528 128H53.432a12 12 0 0 0-11.813 9.891l-7.143 40C33.163 185.246 38.818 192 46.289 192h74.81L98.242 320H19.146a12 12 0 0 0-11.813 9.891l-7.143 40C-1.123 377.246 4.532 384 12.003 384h74.81L72.19 465.891C70.877 473.246 76.532 480 84.003 480h40.632a12 12 0 0 0 11.813-9.891L151.826 384h98.634l-14.623 81.891C234.523 473.246 240.178 480 247.65 480h40.632a12 12 0 0 0 11.813-9.891L315.472 384h79.096a12 12 0 0 0 11.813-9.891l7.143-40c1.313-7.355-4.342-14.109-11.813-14.109h-74.81l22.857-128h79.096a12 12 0 0 0 11.813-9.891zM261.889 320h-98.634l22.857-128h98.634l-22.857 128z"/></svg>

Before

Width:  |  Height:  |  Size: 911 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"/></svg>

Before

Width:  |  Height:  |  Size: 565 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"/></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M640 264v-16c0-8.84-7.16-16-16-16H344v-40h72c17.67 0 32-14.33 32-32V32c0-17.67-14.33-32-32-32H224c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h72v40H16c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h104v40H64c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h160c17.67 0 32-14.33 32-32V352c0-17.67-14.33-32-32-32h-56v-40h304v40h-56c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h160c17.67 0 32-14.33 32-32V352c0-17.67-14.33-32-32-32h-56v-40h104c8.84 0 16-7.16 16-16zM256 128V64h128v64H256zm-64 320H96v-64h96v64zm352 0h-96v-64h96v64z"/></svg>

Before

Width:  |  Height:  |  Size: 622 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512.333 512"><path d="M500.333 0h-47.411c-6.853 0-12.314 5.729-11.986 12.574l3.966 82.759C399.416 41.899 331.672 8 256.001 8 119.34 8 7.899 119.526 8 256.187 8.101 393.068 119.096 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-33.971-33.971c-4.466-4.466-11.64-4.717-16.38-.543C341.308 415.448 300.606 432 256 432c-97.267 0-176-78.716-176-176 0-97.267 78.716-176 176-176 60.892 0 114.506 30.858 146.099 77.8l-101.525-4.865c-6.845-.328-12.574 5.133-12.574 11.986v47.411c0 6.627 5.373 12 12 12h200.333c6.627 0 12-5.373 12-12V12c0-6.627-5.373-12-12-12z"/></svg>

Before

Width:  |  Height:  |  Size: 651 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"/></svg>

Before

Width:  |  Height:  |  Size: 536 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M0 252.118V48C0 21.49 21.49 0 48 0h204.118a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882L293.823 497.941c-18.745 18.745-49.137 18.745-67.882 0L14.059 286.059A48 48 0 0 1 0 252.118zM112 64c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48z"/></svg>

Before

Width:  |  Height:  |  Size: 370 B

View File

@ -2,27 +2,5 @@
<qresource prefix="/">
<file>icons/hicolor/scalable/status/syncthing-default.svg</file>
<file>icons/hicolor/scalable/mimetypes/text-x-generic.svg</file>
<file>icons/hicolor/scalable/fa/certificate.svg</file>
<file>icons/hicolor/scalable/fa/clock.svg</file>
<file>icons/hicolor/scalable/fa/cloud-download-alt.svg</file>
<file>icons/hicolor/scalable/fa/cloud-upload-alt.svg</file>
<file>icons/hicolor/scalable/fa/cogs.svg</file>
<file>icons/hicolor/scalable/fa/exchange-alt.svg</file>
<file>icons/hicolor/scalable/fa/exclamation-triangle.svg</file>
<file>icons/hicolor/scalable/fa/eye.svg</file>
<file>icons/hicolor/scalable/fa/file-archive.svg</file>
<file>icons/hicolor/scalable/fa/folder-open.svg</file>
<file>icons/hicolor/scalable/fa/folder.svg</file>
<file>icons/hicolor/scalable/fa/globe.svg</file>
<file>icons/hicolor/scalable/fa/hashtag.svg</file>
<file>icons/hicolor/scalable/fa/home.svg</file>
<file>icons/hicolor/scalable/fa/link.svg</file>
<file>icons/hicolor/scalable/fa/network-wired.svg</file>
<file>icons/hicolor/scalable/fa/redo.svg</file>
<file>icons/hicolor/scalable/fa/share-alt.svg</file>
<file>icons/hicolor/scalable/fa/tag.svg</file>
<file>icons/hicolor/scalable/fa-non-solid/file.svg</file>
<file>icons/hicolor/scalable/fa-non-solid/folder.svg</file>
<file>icons/hicolor/scalable/fa-non-solid/hdd.svg</file>
</qresource>
</RCC>

View File

@ -169,7 +169,7 @@ QVariant SyncthingDeviceModel::data(const QModelIndex &index, int role) const
case DeviceDetailIcon:
if (index.column() == 0) {
// attribute icons
const auto &icons = m_brightColors ? fontAwesomeIconsForDarkTheme() : fontAwesomeIconsForLightTheme();
const auto &icons = m_brightColors ? forkAwesomeIconsForDarkTheme() : forkAwesomeIconsForLightTheme();
switch (index.row()) {
case 0:
return icons.hashtag;

View File

@ -191,7 +191,7 @@ QVariant SyncthingDirectoryModel::data(const QModelIndex &index, int role) const
case DirectoryDetailIcon:
if (index.column() == 0) {
// attribute icons
const auto &icons = m_brightColors ? fontAwesomeIconsForDarkTheme() : fontAwesomeIconsForLightTheme();
const auto &icons = m_brightColors ? forkAwesomeIconsForDarkTheme() : forkAwesomeIconsForLightTheme();
switch (row) {
case 0:
return icons.hashtag;

View File

@ -165,25 +165,6 @@ QPixmap renderSvgImage(const QByteArray &contents, const QSize &size, int margin
return Detail::renderSvgImage(contents, size, margin);
}
/*!
* \brief Returns the font awesome icon with the specified \a iconName and \a color.
*/
QByteArray loadFontAwesomeIcon(const QString &iconName, const QColor &color, bool solid)
{
auto result = QByteArray();
auto icon = QFile(QString((solid ? QStringLiteral(":/icons/hicolor/scalable/fa/") : QStringLiteral(":/icons/hicolor/scalable/fa-non-solid/"))
% iconName % QStringLiteral(".svg")));
if (!icon.open(QFile::ReadOnly)) {
return result;
}
result = icon.readAll();
const auto pathBegin = result.indexOf("<path ");
if (pathBegin > 0) {
result.insert(pathBegin + 6, (QStringLiteral("fill=\"") % color.name(QColor::HexRgb) % QStringLiteral("\" ")).toUtf8());
}
return result;
}
StatusIconSettings::StatusIconSettings()
: defaultColor({ QStringLiteral("#26B6DB"), QStringLiteral("#0882C8"), QStringLiteral("#FFFFFF") })
, errorColor({ QStringLiteral("#DB3C26"), QStringLiteral("#C80828"), QStringLiteral("#FFFFFF") })
@ -286,34 +267,34 @@ StatusIcons::StatusIcons(const StatusIconSettings &settings)
{
}
FontAwesomeIcons::FontAwesomeIcons(const QColor &color, const QSize &size, int margin)
: hashtag(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("hashtag"), color), size, margin))
, folderOpen(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("folder-open"), color), size, margin))
, globe(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("globe"), color), size, margin))
, home(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("home"), color), size, margin))
, shareAlt(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("share-alt"), color), size, margin))
, refresh(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("redo"), color), size, margin))
, clock(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("clock"), color), size, margin))
, exchangeAlt(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("exchange-alt"), color), size, margin))
, exclamationTriangle(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("exclamation-triangle"), color), size, margin))
, cogs(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("cogs"), color), size, margin))
, link(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("link"), color), size, margin))
, eye(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("eye"), color), size, margin))
, fileArchive(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("file-archive"), color), size, margin))
, folder(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("folder"), color), size, margin))
, certificate(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("certificate"), color), size, margin))
, networkWired(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("network-wired"), color), size, margin))
, cloudDownloadAlt(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("cloud-download-alt"), color), size, margin))
, cloudUploadAlt(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("cloud-upload-alt"), color), size, margin))
, tag(renderSvgImage(loadFontAwesomeIcon(QStringLiteral("tag"), color), size, margin))
ForkAwesomeIcons::ForkAwesomeIcons(QtForkAwesome::Renderer &renderer, const QColor &color, const QSize &size)
: hashtag(renderer.pixmap(QtForkAwesome::Icon::Hashtag, size, color))
, folderOpen(renderer.pixmap(QtForkAwesome::Icon::FolderOpen, size, color))
, globe(renderer.pixmap(QtForkAwesome::Icon::Globe, size, color))
, home(renderer.pixmap(QtForkAwesome::Icon::Home, size, color))
, shareAlt(renderer.pixmap(QtForkAwesome::Icon::ShareAlt, size, color))
, refresh(renderer.pixmap(QtForkAwesome::Icon::Refresh, size, color))
, clock(renderer.pixmap(QtForkAwesome::Icon::ClockO, size, color))
, exchangeAlt(renderer.pixmap(QtForkAwesome::Icon::Exchange, size, color))
, exclamationTriangle(renderer.pixmap(QtForkAwesome::Icon::ExclamationTriangle, size, color))
, cogs(renderer.pixmap(QtForkAwesome::Icon::Cogs, size, color))
, link(renderer.pixmap(QtForkAwesome::Icon::Link, size, color))
, eye(renderer.pixmap(QtForkAwesome::Icon::Eye, size, color))
, fileArchive(renderer.pixmap(QtForkAwesome::Icon::FileArchiveO, size, color))
, folder(renderer.pixmap(QtForkAwesome::Icon::Folder, size, color))
, certificate(renderer.pixmap(QtForkAwesome::Icon::Certificate, size, color))
, networkWired(renderer.pixmap(QtForkAwesome::Icon::Sitemap, size, color))
, cloudDownloadAlt(renderer.pixmap(QtForkAwesome::Icon::CloudDownload, size, color))
, cloudUploadAlt(renderer.pixmap(QtForkAwesome::Icon::CloudUpload, size, color))
, tag(renderer.pixmap(QtForkAwesome::Icon::Tag, size, color))
{
}
IconManager::IconManager()
: m_statusIcons()
, m_trayIcons(m_statusIcons)
, m_fontAwesomeIconsForLightTheme(QColor(10, 10, 10), QSize(64, 64), 8)
, m_fontAwesomeIconsForDarkTheme(Qt::white, QSize(64, 64), 8)
, m_forkAwesomeIconsForLightTheme(m_forkAwesomeRenderer, QColor(10, 10, 10), QSize(64, 64))
, m_fontAwesomeIconsForDarkTheme(m_forkAwesomeRenderer, Qt::white, QSize(64, 64))
{
}

View File

@ -3,6 +3,8 @@
#include "./global.h"
#include <qtforkawesome/qtforkawesome.h>
#include <QIcon>
#include <QSize>
@ -58,7 +60,6 @@ LIB_SYNCTHING_MODEL_EXPORT QByteArray makeSyncthingIcon(
StatusEmblem statusEmblem = StatusEmblem::None);
LIB_SYNCTHING_MODEL_EXPORT QPixmap renderSvgImage(const QString &path, const QSize &size = QSize(32, 32), int margin = 0);
LIB_SYNCTHING_MODEL_EXPORT QPixmap renderSvgImage(const QByteArray &contents, const QSize &size = QSize(32, 32), int margin = 0);
LIB_SYNCTHING_MODEL_EXPORT QByteArray loadFontAwesomeIcon(const QString &iconName, const QColor &color, bool solid = true);
struct LIB_SYNCTHING_MODEL_EXPORT StatusIconSettings {
struct DarkTheme {
@ -115,8 +116,8 @@ inline StatusIcons::StatusIcons()
{
}
struct LIB_SYNCTHING_MODEL_EXPORT FontAwesomeIcons {
FontAwesomeIcons(const QColor &color, const QSize &size, int margin);
struct LIB_SYNCTHING_MODEL_EXPORT ForkAwesomeIcons {
ForkAwesomeIcons(QtForkAwesome::Renderer &renderer, const QColor &color, const QSize &size);
QIcon hashtag;
QIcon folderOpen;
QIcon globe;
@ -146,8 +147,9 @@ public:
void applySettings(const StatusIconSettings *statusIconSettings = nullptr, const StatusIconSettings *trayIconSettings = nullptr);
const StatusIcons &statusIcons() const;
const StatusIcons &trayIcons() const;
const FontAwesomeIcons &fontAwesomeIconsForLightTheme() const;
const FontAwesomeIcons &fontAwesomeIconsForDarkTheme() const;
QtForkAwesome::Renderer &forkAwesomeRenderer();
const ForkAwesomeIcons &forkAwesomeIconsForLightTheme() const;
const ForkAwesomeIcons &forkAwesomeIconsForDarkTheme() const;
Q_SIGNALS:
void statusIconsChanged(const StatusIcons &newStatusIcons, const StatusIcons &newTrayIcons);
@ -157,8 +159,9 @@ private:
StatusIcons m_statusIcons;
StatusIcons m_trayIcons;
FontAwesomeIcons m_fontAwesomeIconsForLightTheme;
FontAwesomeIcons m_fontAwesomeIconsForDarkTheme;
QtForkAwesome::Renderer m_forkAwesomeRenderer;
ForkAwesomeIcons m_forkAwesomeIconsForLightTheme;
ForkAwesomeIcons m_fontAwesomeIconsForDarkTheme;
};
inline void IconManager::applySettings(const StatusIconSettings *statusIconSettings, const StatusIconSettings *trayIconSettings)
@ -186,12 +189,17 @@ inline const StatusIcons &IconManager::trayIcons() const
return m_trayIcons;
}
inline const FontAwesomeIcons &IconManager::fontAwesomeIconsForLightTheme() const
inline QtForkAwesome::Renderer &IconManager::forkAwesomeRenderer()
{
return m_fontAwesomeIconsForLightTheme;
return m_forkAwesomeRenderer;
}
inline const FontAwesomeIcons &IconManager::fontAwesomeIconsForDarkTheme() const
inline const ForkAwesomeIcons &IconManager::forkAwesomeIconsForLightTheme() const
{
return m_forkAwesomeIconsForLightTheme;
}
inline const ForkAwesomeIcons &IconManager::forkAwesomeIconsForDarkTheme() const
{
return m_fontAwesomeIconsForDarkTheme;
}
@ -206,14 +214,14 @@ inline const StatusIcons &trayIcons()
return IconManager::instance().trayIcons();
}
inline const FontAwesomeIcons &fontAwesomeIconsForLightTheme()
inline const ForkAwesomeIcons &forkAwesomeIconsForLightTheme()
{
return IconManager::instance().fontAwesomeIconsForLightTheme();
return IconManager::instance().forkAwesomeIconsForLightTheme();
}
inline const FontAwesomeIcons &fontAwesomeIconsForDarkTheme()
inline const ForkAwesomeIcons &forkAwesomeIconsForDarkTheme()
{
return IconManager::instance().fontAwesomeIconsForDarkTheme();
return IconManager::instance().forkAwesomeIconsForDarkTheme();
}
} // namespace Data

View File

@ -111,9 +111,9 @@ QVariant SyncthingRecentChangesModel::data(const QModelIndex &index, int role) c
switch (index.column()) {
case 0:
if (change.fileChange.local) {
return m_brightColors ? fontAwesomeIconsForDarkTheme().home : fontAwesomeIconsForLightTheme().home;
return m_brightColors ? forkAwesomeIconsForDarkTheme().home : forkAwesomeIconsForLightTheme().home;
} else {
return m_brightColors ? fontAwesomeIconsForDarkTheme().globe : fontAwesomeIconsForLightTheme().globe;
return m_brightColors ? forkAwesomeIconsForDarkTheme().globe : forkAwesomeIconsForLightTheme().globe;
}
}
break;

View File

@ -31,6 +31,7 @@
#include <QClipboard>
#include <QDesktopServices>
#include <QGuiApplication>
#include <QMap>
#include <QNetworkReply>
#include <QPalette>
#include <QQmlEngine>
@ -261,9 +262,20 @@ void SyncthingApplet::updateStatusIconAndTooltip()
emit connectionStatusChanged();
}
QIcon SyncthingApplet::loadFontAwesomeIcon(const QString &name, bool solid) const
QIcon SyncthingApplet::loadForkAwesomeIcon(const QString &name) const
{
return Data::renderSvgImage(Data::loadFontAwesomeIcon(name, QGuiApplication::palette().color(QPalette::WindowText), solid), QSize(32, 32), 8);
using namespace QtForkAwesome;
static const auto mapping = QMap<QString, Icon>({
{ QStringLiteral("cloud-download"), Icon::CloudDownload },
{ QStringLiteral("cloud-upload"), Icon::CloudUpload },
{ QStringLiteral("file"), Icon::FileO },
{ QStringLiteral("folder"), Icon::FolderO },
{ QStringLiteral("hdd"), Icon::HddO },
});
const auto icon = mapping.find(name);
return icon != mapping.cend()
? QIcon(IconManager::instance().forkAwesomeRenderer().pixmap(*icon, QSize(32, 32), QGuiApplication::palette().color(QPalette::WindowText)))
: QIcon();
}
QString SyncthingApplet::formatFileSize(quint64 fileSizeInByte) const
@ -329,8 +341,8 @@ void SyncthingApplet::showAboutDialog()
if (!m_aboutDlg) {
m_aboutDlg = new AboutDialog(nullptr, QStringLiteral(APP_NAME),
QStringLiteral("<p>Developed by " APP_AUTHOR "<br>Syncthing icons from <a href=\"https://syncthing.net\">Syncthing project</a><br>Using "
"icons from <a href=\"https://fontawesome.com\">Font "
"Awesome</a> (see <a href=\"https://fontawesome.com/license\">their license</a>)</p>"),
"icons from <a href=\"https://forkaweso.me\">Fork "
"Awesome</a> (see <a href=\"https://forkaweso.me/Fork-Awesome/license\">their license</a>)</p>"),
QStringLiteral(APP_VERSION), CppUtilities::applicationInfo.dependencyVersions, QStringLiteral(APP_URL), QStringLiteral(APP_DESCRIPTION),
renderSvgImage(makeSyncthingIcon(), QSize(128, 128)).toImage());
m_aboutDlg->setWindowTitle(tr("About") + QStringLiteral(" - " APP_NAME));

View File

@ -119,7 +119,7 @@ public Q_SLOTS:
void showDirectoryErrors(unsigned int directoryIndex);
void copyToClipboard(const QString &text);
void updateStatusIconAndTooltip();
QIcon loadFontAwesomeIcon(const QString &name, bool solid = true) const;
QIcon loadForkAwesomeIcon(const QString &name) const;
QString formatFileSize(quint64 fileSizeInByte) const;
Q_SIGNALS:

View File

@ -479,8 +479,8 @@ ColumnLayout {
IconLabel {
Layout.leftMargin: 10
iconSource: plasmoid.nativeInterface.loadFontAwesomeIcon(
"cloud-download-alt")
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon(
"cloud-download")
iconOpacity: plasmoid.nativeInterface.hasIncomingTraffic ? 1.0 : 0.5
text: plasmoid.nativeInterface.incomingTraffic
tooltip: qsTr("Global incoming traffic")
@ -499,8 +499,8 @@ ColumnLayout {
IconLabel {
Layout.leftMargin: 10
iconSource: plasmoid.nativeInterface.loadFontAwesomeIcon(
"cloud-upload-alt")
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon(
"cloud-upload")
iconOpacity: plasmoid.nativeInterface.hasOutgoingTraffic ? 1.0 : 0.5
text: plasmoid.nativeInterface.outgoingTraffic
tooltip: qsTr("Global outgoing traffic")

View File

@ -7,18 +7,17 @@ RowLayout {
property string context: "?"
IconLabel {
iconSource: plasmoid.nativeInterface.loadFontAwesomeIcon("file", false)
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon("file")
text: statistics.files !== undefined ? statistics.files : "?"
tooltip: context + qsTr(" files")
}
IconLabel {
iconSource: plasmoid.nativeInterface.loadFontAwesomeIcon("folder",
false)
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon("folder")
text: statistics.dirs !== undefined ? statistics.dirs : "?"
tooltip: context + qsTr(" directories")
}
IconLabel {
iconSource: plasmoid.nativeInterface.loadFontAwesomeIcon("hdd", false)
iconSource: plasmoid.nativeInterface.loadForkAwesomeIcon("hdd")
text: statistics.bytes !== undefined ? plasmoid.nativeInterface.formatFileSize(
statistics.bytes) : "?"
tooltip: context + qsTr(" size")

View File

@ -256,8 +256,8 @@ void TrayWidget::showAboutDialog()
QStringLiteral(
"<p>Developed by " APP_AUTHOR
"<br>Fallback icons from KDE/Breeze project<br>Syncthing icons from <a href=\"https://syncthing.net\">Syncthing project</a><br>Using "
"icons from <a href=\"https://fontawesome.com\">Font "
"Awesome</a> (see <a href=\"https://fontawesome.com/license\">their license</a>)</p>"),
"icons from <a href=\"https://forkaweso.me\">Fork "
"Awesome</a> (see <a href=\"https://forkaweso.me/Fork-Awesome/license\">their license</a>))</p>"),
QString(), {}, QStringLiteral(APP_URL), QString(), renderSvgImage(makeSyncthingIcon(), QSize(128, 128)).toImage());
s_aboutDlg->setWindowTitle(tr("About") + QStringLiteral(" - " APP_NAME));
s_aboutDlg->setWindowIcon(QIcon(QStringLiteral(":/icons/hicolor/scalable/app/syncthingtray.svg")));
@ -630,18 +630,19 @@ void TrayWidget::updateTraffic()
const auto colorActive = palette.color(QPalette::WindowText);
const auto colorInactive = QColor((colorActive.red() + colorBackground.red()) / 2, (colorActive.green() + colorBackground.green()) / 2,
(colorActive.blue() + colorBackground.blue()) / 2);
const auto renderIcon
= [&size](const QString &name, const QColor &color) { return Data::renderSvgImage(Data::loadFontAwesomeIcon(name, color), size); };
const auto renderIcon = [&size](QtForkAwesome::Icon icon, const QColor &color) {
return IconManager::instance().forkAwesomeRenderer().pixmap(icon, size, color);
};
struct {
QPixmap uploadIconActive;
QPixmap uploadIconInactive;
QPixmap downloadIconActive;
QPixmap downloadIconInactive;
} icons;
icons.uploadIconActive = renderIcon(QStringLiteral("cloud-upload-alt"), colorActive);
icons.uploadIconInactive = renderIcon(QStringLiteral("cloud-upload-alt"), colorInactive);
icons.downloadIconActive = renderIcon(QStringLiteral("cloud-download-alt"), colorActive);
icons.downloadIconInactive = renderIcon(QStringLiteral("cloud-download-alt"), colorInactive);
icons.uploadIconActive = renderIcon(QtForkAwesome::Icon::CloudUpload, colorActive);
icons.uploadIconInactive = renderIcon(QtForkAwesome::Icon::CloudUpload, colorInactive);
icons.downloadIconActive = renderIcon(QtForkAwesome::Icon::CloudDownload, colorActive);
icons.downloadIconInactive = renderIcon(QtForkAwesome::Icon::CloudDownload, colorInactive);
return icons;
}();