summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Slimber/Qt/QtMenulet.h')
m---------Slimber0
-rw-r--r--Slimber/Qt/QtMenulet.h65
2 files changed, 0 insertions, 65 deletions
diff --git a/Slimber b/Slimber
new file mode 160000
+Subproject 723115ef8542c640580ea4751fca3c359a79dec
diff --git a/Slimber/Qt/QtMenulet.h b/Slimber/Qt/QtMenulet.h
deleted file mode 100644
index 4ac9140..0000000
--- a/Slimber/Qt/QtMenulet.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#pragma once
-
-#include <QCoreApplication>
-#include <QMenu>
-#include <QString>
-#include <QSystemTrayIcon>
-#include <QObject>
-#include <QPixmap>
-
-#include "Slimber/Menulet.h"
-
-class QtMenulet : public QObject, public Menulet {
- Q_OBJECT
- public:
- QtMenulet() {
- trayIcon.setIcon(QPixmap(":/icons/UsersOffline.png"));
- trayIcon.setContextMenu(&menu);
- trayIcon.show();
- }
-
- void clear() {
- menu.clear();
- }
-
- void addItem(const Swift::String& name, const Swift::String& icon) {
- menu.addAction(getIcon(icon), QString::fromUtf8(name.getUTF8Data()));
- }
-
- void addAboutItem() {
- menu.addAction("About");
- }
-
- void addRestartItem() {
- menu.addAction("Restart", this, SLOT(restart()));
- }
-
- void addExitItem() {
- menu.addAction("Exit", qApp, SLOT(quit()));
- }
-
- void addSeparator() {
- menu.addSeparator();
- }
-
- void setIcon(const Swift::String& icon) {
- trayIcon.setIcon(getIcon(icon));
- }
-
- private:
- QPixmap getIcon(const Swift::String& name) {
- return QPixmap(":/icons/" + QString::fromUtf8(name.getUTF8Data()) + ".png");
- }
-
- private slots:
- void showAboutDialog() {
- }
-
- void restart() {
- onRestartClicked();
- }
-
- private:
- QMenu menu;
- QSystemTrayIcon trayIcon;
-};