mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Remove the last workaround in tray implementation
Since tdesktop gets icon theme pretty well now, there's no need for any workaround.
This commit is contained in:
parent
d7ef484aec
commit
620c596200
1 changed files with 2 additions and 28 deletions
|
@ -52,12 +52,9 @@ extern "C" {
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
|
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr auto kDisableTrayCounter = "TDESKTOP_DISABLE_TRAY_COUNTER"_cs;
|
|
||||||
constexpr auto kPanelTrayIconName = "telegram-panel"_cs;
|
constexpr auto kPanelTrayIconName = "telegram-panel"_cs;
|
||||||
constexpr auto kMutePanelTrayIconName = "telegram-mute-panel"_cs;
|
constexpr auto kMutePanelTrayIconName = "telegram-mute-panel"_cs;
|
||||||
constexpr auto kAttentionPanelTrayIconName = "telegram-attention-panel"_cs;
|
constexpr auto kAttentionPanelTrayIconName = "telegram-attention-panel"_cs;
|
||||||
|
@ -201,13 +198,6 @@ QIcon TrayIconGen(int counter, bool muted) {
|
||||||
|
|
||||||
const auto iconName = GetTrayIconName(counter, muted);
|
const auto iconName = GetTrayIconName(counter, muted);
|
||||||
|
|
||||||
if (qEnvironmentVariableIsSet(kDisableTrayCounter.utf8())
|
|
||||||
&& !iconName.isEmpty()) {
|
|
||||||
const auto result = QIcon::fromTheme(iconName);
|
|
||||||
UpdateIconRegenerationNeeded(result, counter, muted, iconThemeName);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
QIcon result;
|
QIcon result;
|
||||||
QIcon systemIcon;
|
QIcon systemIcon;
|
||||||
|
|
||||||
|
@ -261,8 +251,7 @@ QIcon TrayIconGen(int counter, bool muted) {
|
||||||
|
|
||||||
auto iconImage = currentImageBack;
|
auto iconImage = currentImageBack;
|
||||||
|
|
||||||
if (!qEnvironmentVariableIsSet(kDisableTrayCounter.utf8())
|
if (counter > 0) {
|
||||||
&& counter > 0) {
|
|
||||||
const auto &bg = muted
|
const auto &bg = muted
|
||||||
? st::trayCounterBgMute
|
? st::trayCounterBgMute
|
||||||
: st::trayCounterBg;
|
: st::trayCounterBg;
|
||||||
|
@ -590,15 +579,7 @@ void MainWindow::psTrayMenuUpdated() {
|
||||||
void MainWindow::setSNITrayIcon(int counter, bool muted) {
|
void MainWindow::setSNITrayIcon(int counter, bool muted) {
|
||||||
const auto iconName = GetTrayIconName(counter, muted);
|
const auto iconName = GetTrayIconName(counter, muted);
|
||||||
|
|
||||||
if (qEnvironmentVariableIsSet(kDisableTrayCounter.utf8())
|
if (IsIndicatorApplication()) {
|
||||||
&& !iconName.isEmpty()) {
|
|
||||||
if (_sniTrayIcon->iconName() == iconName) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_sniTrayIcon->setIconByName(iconName);
|
|
||||||
_sniTrayIcon->setToolTipIconByName(iconName);
|
|
||||||
} else if (IsIndicatorApplication()) {
|
|
||||||
if (!IsIconRegenerationNeeded(counter, muted)
|
if (!IsIconRegenerationNeeded(counter, muted)
|
||||||
&& _trayIconFile
|
&& _trayIconFile
|
||||||
&& _sniTrayIcon->iconName() == _trayIconFile->fileName()) {
|
&& _sniTrayIcon->iconName() == _trayIconFile->fileName()) {
|
||||||
|
@ -871,13 +852,6 @@ void MainWindow::LibsLoaded() {
|
||||||
qDBusRegisterMetaType<IconPixmap>();
|
qDBusRegisterMetaType<IconPixmap>();
|
||||||
qDBusRegisterMetaType<IconPixmapList>();
|
qDBusRegisterMetaType<IconPixmapList>();
|
||||||
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||||
|
|
||||||
if (!qEnvironmentVariableIsSet(kDisableTrayCounter.utf8())) {
|
|
||||||
g_message(
|
|
||||||
"You can disable tray icon counter with %s "
|
|
||||||
"and make it look better if it is monochrome.",
|
|
||||||
kDisableTrayCounter.utf8().constData());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::initTrayMenuHook() {
|
void MainWindow::initTrayMenuHook() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue