D25119: KF5::BreezeIcons shared library to have all breeze/breeze-dark icons and default to breeze icons set

Alain Boyer noreply at phabricator.kde.org
Fri Oct 30 21:47:46 GMT 2020


aboyer added a comment.


  I've tested this patch since I'd really like to use Kate with the dark theme on Windows. I built Kate on Windows using Craft, added KF5::BreezeIcons as a dependency for the kate-bin target, and set the QIcon theme name in the KateColorSchemeChooser class. This did not work.
  
  The first problem I ran into was a CMake issue when adding KF5::BreezeIcons as a dependency. It turns out that KF5BreezeIcons.lib is not created since the new KF5BreezeIcons shared library does not export any symbols. Exporting a dummy function with __declspec(dllexport) fixed the problem and Kate compiled successfully.
  
  The second problem was that no icons were rendered regardless of which theme was selected. This was caused by the fact that Kate did not actually link to KF5BreezeIcons since no symbol from that library was used. Calling the dummy function added earlier from main() fixed the linking problem. With this, Kate loaded KF5BreezeIcons.dll and the correct icons were used when switching to the Breeze dark theme. Success!
  
  I did my testing with MSVC and I'm wondering if the patch was originally tested with MinGW. I can't recall if MinGW has a different behavior when it comes to exporting symbols from a shared library and linking to said shared library.
  
  > Applications wanting to have breeze icons available, can just link with this and be done
  
  It might not be quite so simple as just linking to a library. Obviously, the hacks described above to make this patch work are not acceptable. However, they could be modified slightly. For example, the call to QIcon::setThemeName() could be made in KF5BreezeIcons.dll instead of in Kate. We could export a class with a static function that sets the theme name based on the palette lightness, just like it is now done for the fallback theme. Kate would then call this static function in KateColorSchemeChooser. It's a bit less elegant but would address the issues mentioned above. Unless someone knows how to force the linking to a shared library even if no symbols are exported and/or used. Thoughts?

REPOSITORY
  R266 Breeze Icons

REVISION DETAIL
  https://phabricator.kde.org/D25119

To: cullmann, #frameworks, vonreth, dfaure, rempt, ndavis, mart, alex-l
Cc: aboyer, sars, wrobelda, davidedmundson, broulik, rempt, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20201030/c1303975/attachment.htm>


More information about the Kde-frameworks-devel mailing list