Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
trinity/include/desktop.h

29 lines
580 B
C
Raw Normal View History

2021-07-21 16:08:15 -04:00
#pragma once
#include <QSystemTrayIcon>
#include <QApplication>
class Desktop : public QObject
{
Q_OBJECT
public:
Q_INVOKABLE void showTrayIcon(const bool shouldHide) {
QApplication::setQuitOnLastWindowClosed(shouldHide);
if(shouldHide)
icon->show();
else
icon->hide();
2021-07-21 16:08:15 -04:00
}
Q_INVOKABLE void showMessage(const QString title, const QString content) {
icon->showMessage(title, content);
}
Q_INVOKABLE bool isTrayIconEnabled() {
return icon->isVisible();;
}
2021-07-21 16:08:15 -04:00
QSystemTrayIcon* icon;
};