diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2015-11-23 23:48:56 +0100 |
---|---|---|
committer | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-11-23 23:48:56 +0100 |
commit | 281d8efd8fc55d847cf356954c3b33853c4e2a35 (patch) | |
tree | e6b8f538cefbbb02b83a692282c32f60927a857a /trayicon.cpp | |
parent | 95a68a47e10d59cc2d229ad4492264d6a93206f9 (diff) |
uncrustify
Diffstat (limited to 'trayicon.cpp')
-rw-r--r-- | trayicon.cpp | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/trayicon.cpp b/trayicon.cpp index feaa1e9f..4c1246dc 100644 --- a/trayicon.cpp +++ b/trayicon.cpp @@ -2,65 +2,61 @@ TrayIcon::TrayIcon(QMainWindow *parent) { - parentwin = parent; + parentwin = parent; - createActions(); - createTrayIcon(); + createActions(); + createTrayIcon(); - sysTrayIcon->setIcon(QIcon(":/artwork/icon.png")); + sysTrayIcon->setIcon(QIcon(":/artwork/icon.png")); - sysTrayIcon->show(); - - QObject::connect(sysTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), - this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); + sysTrayIcon->show(); + QObject::connect(sysTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), + this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); } void TrayIcon::setVisible(bool visible) { - if(visible == true) { - parentwin->show(); - } else { - parentwin->hide(); - } + if (visible == true) + parentwin->show(); + else + parentwin->hide(); } void TrayIcon::createActions() { -// minimizeAction = new QAction(tr("Mi&nimize"), this); -// connect(minimizeAction, SIGNAL(triggered()), this, SLOT(hide())); +// minimizeAction = new QAction(tr("Mi&nimize"), this); +// connect(minimizeAction, SIGNAL(triggered()), this, SLOT(hide())); -// maximizeAction = new QAction(tr("Ma&ximize"), this); -// connect(maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized())); +// maximizeAction = new QAction(tr("Ma&ximize"), this); +// connect(maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized())); -// restoreAction = new QAction(tr("&Restore"), this); -// connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal())); +// restoreAction = new QAction(tr("&Restore"), this); +// connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal())); - quitAction = new QAction(tr("&Quit"), this); - connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); + quitAction = new QAction(tr("&Quit"), this); + connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); } - void TrayIcon::createTrayIcon() { - trayIconMenu = new QMenu(this); -// trayIconMenu->addAction(minimizeAction); -// trayIconMenu->addAction(maximizeAction); -// trayIconMenu->addAction(restoreAction); -// trayIconMenu->addSeparator(); - trayIconMenu->addAction(quitAction); - - sysTrayIcon = new QSystemTrayIcon(this); - sysTrayIcon->setContextMenu(trayIconMenu); + trayIconMenu = new QMenu(this); +// trayIconMenu->addAction(minimizeAction); +// trayIconMenu->addAction(maximizeAction); +// trayIconMenu->addAction(restoreAction); +// trayIconMenu->addSeparator(); + trayIconMenu->addAction(quitAction); + + sysTrayIcon = new QSystemTrayIcon(this); + sysTrayIcon->setContextMenu(trayIconMenu); } void TrayIcon::showHideParent() { - if(parentwin->isVisible() == true) { - parentwin->hide(); - } else { - parentwin->show(); - } + if (parentwin->isVisible() == true) + parentwin->hide(); + else + parentwin->show(); } void TrayIcon::iconActivated(QSystemTrayIcon::ActivationReason reason) @@ -68,7 +64,7 @@ void TrayIcon::iconActivated(QSystemTrayIcon::ActivationReason reason) switch (reason) { case QSystemTrayIcon::Trigger: case QSystemTrayIcon::DoubleClick: - showHideParent(); + showHideParent(); break; case QSystemTrayIcon::MiddleClick: showMessage("test", "test msg", 1000); |