diff --git a/Telegram/SourceFiles/gui/contextmenu.cpp b/Telegram/SourceFiles/gui/contextmenu.cpp index 4d12013bf..4af8e99c2 100644 --- a/Telegram/SourceFiles/gui/contextmenu.cpp +++ b/Telegram/SourceFiles/gui/contextmenu.cpp @@ -363,6 +363,7 @@ void PopupMenu::paintEvent(QPaintEvent *e) { QPainter::CompositionMode m = p.compositionMode(); p.setCompositionMode(QPainter::CompositionMode_Source); if (_a_hide.animating()) { + p.setOpacity(a_opacity.current()); p.drawPixmap(0, 0, _cache); return; } @@ -494,13 +495,9 @@ void PopupMenu::fastHide() { void PopupMenu::hideStart() { if (isHidden()) return; - if (cPlatform() == dbipMac) { - fastHide(); // animated itself - } else { - _cache = myGrab(this); - a_opacity.start(0); - _a_hide.start(); - } + _cache = myGrab(this); + a_opacity.start(0); + _a_hide.start(); } void PopupMenu::hideFinish() { diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 2d2d2245e..d5e7c8be3 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -453,13 +453,13 @@ void Window::firstShow() { ? lng_disable_notifications_from_tray : lng_enable_notifications_from_tray); if (cPlatform() == dbipWindows || cPlatform() == dbipMac) { - trayIconMenu->addAction(notificationItem, this, SLOT(toggleDisplayNotifyFromTray()))->setEnabled(true); trayIconMenu->addAction(lang(lng_minimize_to_tray), this, SLOT(minimizeToTray()))->setEnabled(true); + trayIconMenu->addAction(notificationItem, this, SLOT(toggleDisplayNotifyFromTray()))->setEnabled(true); trayIconMenu->addAction(lang(lng_quit_from_tray), this, SLOT(quitFromTray()))->setEnabled(true); } else { - trayIconMenu->addAction(notificationItem, this, SLOT(toggleDisplayNotifyFromTray()))->setEnabled(true); trayIconMenu->addAction(lang(lng_open_from_tray), this, SLOT(showFromTray()))->setEnabled(true); trayIconMenu->addAction(lang(lng_minimize_to_tray), this, SLOT(minimizeToTray()))->setEnabled(true); + trayIconMenu->addAction(notificationItem, this, SLOT(toggleDisplayNotifyFromTray()))->setEnabled(true); trayIconMenu->addAction(lang(lng_quit_from_tray), this, SLOT(quitFromTray()))->setEnabled(true); } psUpdateWorkmode(); @@ -1047,17 +1047,20 @@ void Window::updateTrayMenu(bool force) { QString notificationItem = lang(cDesktopNotify() ? lng_disable_notifications_from_tray : lng_enable_notifications_from_tray); - QAction *first = trayIconMenu->actions().at(0); - first->setText(notificationItem); if (cPlatform() == dbipWindows || cPlatform() == dbipMac) { - QAction *second = trayIconMenu->actions().at(1); - second->setText(lang(active ? lng_minimize_to_tray : lng_open_from_tray)); - disconnect(second, SIGNAL(triggered(bool)), 0, 0); - connect(second, SIGNAL(triggered(bool)), this, active ? SLOT(minimizeToTray()) : SLOT(showFromTray())); - } else { - QAction *third = trayIconMenu->actions().at(2); - third->setDisabled(!isVisible()); - } + QAction *toggle = trayIconMenu->actions().at(0); + disconnect(toggle, SIGNAL(triggered(bool)), this, SLOT(minimizeToTray())); + disconnect(toggle, SIGNAL(triggered(bool)), this, SLOT(showFromTray())); + connect(toggle, SIGNAL(triggered(bool)), this, active ? SLOT(minimizeToTray()) : SLOT(showFromTray())); + toggle->setText(lang(active ? lng_minimize_to_tray : lng_open_from_tray)); + + trayIconMenu->actions().at(1)->setText(notificationItem); + } else { + QAction *minimize = trayIconMenu->actions().at(1); + minimize->setDisabled(!isVisible()); + + trayIconMenu->actions().at(2)->setText(notificationItem); + } #ifndef Q_OS_WIN if (trayIcon) { trayIcon->setContextMenu((active || cPlatform() != dbipMac) ? trayIconMenu : 0);