mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 19:38:48 +03:00
Setting badge count unsupported in Qt6
This commit is contained in:
parent
d7eb62a5b5
commit
a0bfe067fd
1 changed files with 12 additions and 14 deletions
|
@ -14,10 +14,6 @@
|
||||||
|
|
||||||
#include "TrayIcon.h"
|
#include "TrayIcon.h"
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
|
||||||
#include <QtMacExtras>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MsgCountComposedIcon::MsgCountComposedIcon(const QString &filename)
|
MsgCountComposedIcon::MsgCountComposedIcon(const QString &filename)
|
||||||
: QIconEngine()
|
: QIconEngine()
|
||||||
{
|
{
|
||||||
|
@ -127,18 +123,20 @@ TrayIcon::TrayIcon(const QString &filename, QWindow *parent)
|
||||||
void
|
void
|
||||||
TrayIcon::setUnreadCount(int count)
|
TrayIcon::setUnreadCount(int count)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(count);
|
||||||
// Use the native badge counter in MacOS.
|
// Use the native badge counter in MacOS.
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MAC)
|
||||||
// currently, to avoid writing obj-c code, ignore deprecated warnings on the badge functions
|
// FIXME: Reimplement this for Qt6
|
||||||
#pragma clang diagnostic push
|
//// currently, to avoid writing obj-c code, ignore deprecated warnings on the badge functions
|
||||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
//#pragma clang diagnostic push
|
||||||
auto labelText = count == 0 ? "" : QString::number(count);
|
//#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
// auto labelText = count == 0 ? "" : QString::number(count);
|
||||||
if (labelText == QtMac::badgeLabelText())
|
//
|
||||||
return;
|
// if (labelText == QtMac::badgeLabelText())
|
||||||
|
// return;
|
||||||
QtMac::setBadgeLabelText(labelText);
|
//
|
||||||
#pragma clang diagnostic pop
|
// QtMac::setBadgeLabelText(labelText);
|
||||||
|
//#pragma clang diagnostic pop
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
// FIXME: Find a way to use Windows apis for the badge counter (if any).
|
// FIXME: Find a way to use Windows apis for the badge counter (if any).
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue