: QObject(parent),
_mode(Invalid),
_state(Passive),
- _inhibitActivation(false),
_passiveIcon(DesktopIcon("quassel_inactive")),
_activeIcon(DesktopIcon("quassel")),
_needsAttentionIcon(DesktopIcon("quassel_message")),
_associatedWidget(parent)
{
Q_ASSERT(parent);
-
- qApp->installEventFilter(this);
}
SystemTray::~SystemTray() {
}
void SystemTray::activate(SystemTray::ActivationReason reason) {
-
emit activated(reason);
-
- if(reason == Trigger && !isActivationInhibited()) {
- GraphicalUi::toggleMainWidget();
- }
-}
-
-bool SystemTray::eventFilter(QObject *obj, QEvent *event) {
- if(event->type() == QEvent::MouseMove || event->type() == QEvent::MouseButtonRelease) {
- _inhibitActivation = false;
- }
- return QObject::eventFilter(obj, event);
}