diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-07-12 14:37:39 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-11-23 00:52:13 +0100 |
commit | d2e163d2e4c388a42a006ddd43c58bbecc3729a9 (patch) | |
tree | 3b36337a3ce6089b7faed53d14ffb10a80dff316 /src/plugins/platforms/windows/qwindowstheme.cpp | |
parent | 5ae635548789098f8097647e23b91f2ea123b78f (diff) |
Add initial implementation of a Windows icon engine
Implement an icon engine for Windows that renders glyphs from the
Segoe Fluent Icons font on Windows 11 and the Segoe MDL2 Assets fonts
on Windows 10. These fonts are installed on the respective Windows
versions by default, and otherwise freely avialable for deployment.
Icons from that font will mostly be based on single code points, but as
the font is specifically designed to allow combining glyphs by layering,
the implementation supports multiple code points as well, and can also
use a surrogate pair as well to render e.g. an emoji.
Task-number: QTBUG-102346
Change-Id: Ib47a267c3a1878d8f0e00dd954496fc338bb0110
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowstheme.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowstheme.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index 4b948b0397..e2ab09afb9 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -7,6 +7,7 @@ #include "qwindowsmenu.h" #include "qwindowsdialoghelpers.h" #include "qwindowscontext.h" +#include "qwindowsiconengine.h" #include "qwindowsintegration.h" #if QT_CONFIG(systemtrayicon) # include "qwindowssystemtrayicon.h" @@ -1174,6 +1175,14 @@ QIcon QWindowsTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOpt return QIcon(new QWindowsFileIconEngine(fileInfo, iconOptions)); } +QIconEngine *QWindowsTheme::createIconEngine(const QString &iconName) const +{ + static bool experimentalIconEngines = qEnvironmentVariableIsSet("QT_ENABLE_EXPERIMENTAL_ICON_ENGINES"); + if (experimentalIconEngines) + return new QWindowsIconEngine(iconName); + return nullptr; +} + static inline bool doUseNativeMenus() { const unsigned options = QWindowsIntegration::instance()->options(); |