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
2021-07-21 16:08:15 -04:00

24 lines
495 B
C++

#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->hide();
else
icon->show();
}
Q_INVOKABLE void showMessage(const QString title, const QString content) {
icon->showMessage(title, content);
}
QSystemTrayIcon* icon;
};