mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-03 18:49:30 +00:00
Switch tray to symbolic icons
This allows to rely on GTK recoloring rather than requiring the user to have an icon theme
This commit is contained in:
@@ -494,6 +494,25 @@ void InstallLauncher() {
|
||||
DEBUG_LOG(("App Info: Icon copied to '%1'").arg(icon));
|
||||
}
|
||||
|
||||
const auto symbolicIcons = icons + u"/hicolor/symbolic/apps/"_q;
|
||||
if (!QDir().exists(symbolicIcons)) QDir().mkpath(symbolicIcons);
|
||||
|
||||
const auto monochromeIcons = {
|
||||
QString(),
|
||||
u"attention"_q,
|
||||
u"mute"_q,
|
||||
};
|
||||
|
||||
for (const auto &icon : monochromeIcons) {
|
||||
QFile::copy(
|
||||
u":/gui/icons/tray/monochrome%1.svg"_q.arg(
|
||||
!icon.isEmpty() ? u"_"_q + icon : QString()),
|
||||
symbolicIcons
|
||||
+ ApplicationIconName()
|
||||
+ (!icon.isEmpty() ? u"-"_q + icon : QString())
|
||||
+ u"-symbolic.svg"_q);
|
||||
}
|
||||
|
||||
QProcess::execute("update-desktop-database", {
|
||||
applicationsPath
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user