mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Always use app ID based icon name
This allows to unify it between flatpak and non-flatpak builds and corresponds to what most other GUI apps on Linux do
This commit is contained in:
parent
b14c2878b3
commit
228bbc1e8e
5 changed files with 16 additions and 18 deletions
|
@ -2063,14 +2063,14 @@ if (LINUX AND DESKTOP_APP_USE_PACKAGED)
|
||||||
configure_file("../lib/xdg/org.telegram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" @ONLY)
|
configure_file("../lib/xdg/org.telegram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" @ONLY)
|
||||||
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml")
|
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml")
|
||||||
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "telegram.png")
|
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "org.telegram.desktop.png")
|
||||||
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "telegram.png")
|
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "org.telegram.desktop.png")
|
||||||
install(FILES "Resources/art/icon48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "telegram.png")
|
install(FILES "Resources/art/icon48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "org.telegram.desktop.png")
|
||||||
install(FILES "Resources/art/icon64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "telegram.png")
|
install(FILES "Resources/art/icon64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "org.telegram.desktop.png")
|
||||||
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "telegram.png")
|
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "org.telegram.desktop.png")
|
||||||
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "telegram.png")
|
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "org.telegram.desktop.png")
|
||||||
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "telegram.png")
|
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "org.telegram.desktop.png")
|
||||||
install(FILES "Resources/icons/tray_monochrome.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "telegram-symbolic.svg")
|
install(FILES "Resources/icons/tray_monochrome.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "org.telegram.desktop-symbolic.svg")
|
||||||
install(FILES "../lib/xdg/org.telegram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
install(FILES "../lib/xdg/org.telegram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.telegram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
|
||||||
|
|
|
@ -488,6 +488,7 @@ void InstallLauncher() {
|
||||||
|
|
||||||
const auto icon = icons + ApplicationIconName() + u".png"_q;
|
const auto icon = icons + ApplicationIconName() + u".png"_q;
|
||||||
QFile::remove(icon);
|
QFile::remove(icon);
|
||||||
|
QFile::remove(icons + u"telegram.png"_q);
|
||||||
if (QFile::copy(u":/gui/art/logo_256.png"_q, icon)) {
|
if (QFile::copy(u":/gui/art/logo_256.png"_q, icon)) {
|
||||||
DEBUG_LOG(("App Info: Icon copied to '%1'").arg(icon));
|
DEBUG_LOG(("App Info: Icon copied to '%1'").arg(icon));
|
||||||
}
|
}
|
||||||
|
@ -758,9 +759,8 @@ QImage DefaultApplicationIcon() {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ApplicationIconName() {
|
QString ApplicationIconName() {
|
||||||
static const auto Result = KSandbox::isFlatpak()
|
static const auto Result = QGuiApplication::desktopFileName().remove(
|
||||||
? qEnvironmentVariable("FLATPAK_ID")
|
u"._"_q + Core::Launcher::Instance().instanceHash());
|
||||||
: u"telegram"_q;
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,11 +30,11 @@ namespace {
|
||||||
using namespace gi::repository;
|
using namespace gi::repository;
|
||||||
|
|
||||||
[[nodiscard]] QString PanelIconName(int counter, bool muted) {
|
[[nodiscard]] QString PanelIconName(int counter, bool muted) {
|
||||||
return (counter > 0)
|
return ApplicationIconName() + ((counter > 0)
|
||||||
? (muted
|
? (muted
|
||||||
? u"telegram-mute-panel"_q
|
? u"-mute"_q
|
||||||
: u"telegram-attention-panel"_q)
|
: u"-attention"_q)
|
||||||
: u"telegram-panel"_q;
|
: QString()) + u"-panel"_q;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -3,7 +3,7 @@ Name=Telegram
|
||||||
Comment=New era of messaging
|
Comment=New era of messaging
|
||||||
TryExec=telegram-desktop
|
TryExec=telegram-desktop
|
||||||
Exec=telegram-desktop -- %u
|
Exec=telegram-desktop -- %u
|
||||||
Icon=telegram
|
Icon=org.telegram.desktop
|
||||||
Terminal=false
|
Terminal=false
|
||||||
StartupWMClass=TelegramDesktop
|
StartupWMClass=TelegramDesktop
|
||||||
Type=Application
|
Type=Application
|
||||||
|
|
|
@ -149,8 +149,6 @@ parts:
|
||||||
version="${version}$(git describe --tags | sed 's,^v[^-]\+,,')"
|
version="${version}$(git describe --tags | sed 's,^v[^-]\+,,')"
|
||||||
|
|
||||||
craftctl set version="$version"
|
craftctl set version="$version"
|
||||||
|
|
||||||
sed -i 's|^Icon=telegram$|Icon=${SNAP}/meta/gui/icon.png|g' lib/xdg/org.telegram.desktop.desktop
|
|
||||||
override-build: |
|
override-build: |
|
||||||
craftctl default
|
craftctl default
|
||||||
rm -rf "$CRAFT_PART_INSTALL/usr/share/icons"
|
rm -rf "$CRAFT_PART_INSTALL/usr/share/icons"
|
||||||
|
|
Loading…
Add table
Reference in a new issue