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
2022-08-15 21:53:56 -04:00

27 lines
580 B
C++
Executable file

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