void NotifyWindow::mousePressEvent(QMouseEvent *e) { if (!history) return; PeerId peer = history->peer->id; if (e->button() == Qt::RightButton) { unlinkHistoryAndNotify(); } else if (history) { App::wnd()->showFromTray(); App::wnd()->hideSettings(); App::main()->showPeer(peer, 0, false, true); e->ignore(); } }
void NotifyWindow::mousePressEvent(QMouseEvent *e) { if (!history) return; PeerId peer = history->peer->id; if (e->button() == Qt::RightButton) { unlinkHistoryAndNotify(); } else if (history) { App::wnd()->showFromTray(); if (App::passcoded()) { App::wnd()->passcodeWidget()->setInnerFocus(); App::wnd()->notifyClear(); } else { App::wnd()->hideSettings(); App::main()->showPeer(peer, (history->peer->chat && item && item->notifyByFrom() && item->id > 0) ? item->id : 0, false, true); } e->ignore(); } }
NotifyWindow::NotifyWindow(HistoryItem *msg, int32 x, int32 y) : history(msg->history()), item(msg) #ifdef Q_OS_WIN , started(GetTickCount()) #endif , close(this, st::notifyClose) , alphaDuration(st::notifyFastAnim) , posDuration(st::notifyFastAnim) , hiding(false) , _index(0) , aOpacity(0) , aOpacityFunc(st::notifyFastAnimFunc) , aY(y + st::notifyHeight + st::notifyDeltaY) { updateNotifyDisplay(); hideTimer.setSingleShot(true); connect(&hideTimer, SIGNAL(timeout()), this, SLOT(hideByTimer())); inputTimer.setSingleShot(true); connect(&inputTimer, SIGNAL(timeout()), this, SLOT(checkLastInput())); connect(&close, SIGNAL(clicked()), this, SLOT(unlinkHistoryAndNotify())); close.setAcceptBoth(true); close.move(st::notifyWidth - st::notifyClose.width - st::notifyClosePos.x(), st::notifyClosePos.y()); close.show(); aY.start(y); setGeometry(x, aY.current(), st::notifyWidth, st::notifyHeight); aOpacity.start(1); setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint); setAttribute(Qt::WA_MacAlwaysShowToolWindow); show(); setWindowOpacity(aOpacity.current()); alphaDuration = posDuration = st::notifyFastAnim; anim::start(this); checkLastInput(); }
void NotifyWindow::itemRemoved(HistoryItem *del) { if (item == del) { unlinkHistoryAndNotify(); } }