mirror of https://github.com/procxx/kepka.git
fixed popup hide, moved toggle notifications display moved under open / minimize in tray menu
This commit is contained in:
parent
17114350c4
commit
4f562bca09
|
@ -363,6 +363,7 @@ void PopupMenu::paintEvent(QPaintEvent *e) {
|
||||||
QPainter::CompositionMode m = p.compositionMode();
|
QPainter::CompositionMode m = p.compositionMode();
|
||||||
p.setCompositionMode(QPainter::CompositionMode_Source);
|
p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
if (_a_hide.animating()) {
|
if (_a_hide.animating()) {
|
||||||
|
p.setOpacity(a_opacity.current());
|
||||||
p.drawPixmap(0, 0, _cache);
|
p.drawPixmap(0, 0, _cache);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -494,13 +495,9 @@ void PopupMenu::fastHide() {
|
||||||
void PopupMenu::hideStart() {
|
void PopupMenu::hideStart() {
|
||||||
if (isHidden()) return;
|
if (isHidden()) return;
|
||||||
|
|
||||||
if (cPlatform() == dbipMac) {
|
_cache = myGrab(this);
|
||||||
fastHide(); // animated itself
|
a_opacity.start(0);
|
||||||
} else {
|
_a_hide.start();
|
||||||
_cache = myGrab(this);
|
|
||||||
a_opacity.start(0);
|
|
||||||
_a_hide.start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupMenu::hideFinish() {
|
void PopupMenu::hideFinish() {
|
||||||
|
|
|
@ -453,13 +453,13 @@ void Window::firstShow() {
|
||||||
? lng_disable_notifications_from_tray : lng_enable_notifications_from_tray);
|
? lng_disable_notifications_from_tray : lng_enable_notifications_from_tray);
|
||||||
|
|
||||||
if (cPlatform() == dbipWindows || cPlatform() == dbipMac) {
|
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(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);
|
trayIconMenu->addAction(lang(lng_quit_from_tray), this, SLOT(quitFromTray()))->setEnabled(true);
|
||||||
} else {
|
} 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_open_from_tray), this, SLOT(showFromTray()))->setEnabled(true);
|
||||||
trayIconMenu->addAction(lang(lng_minimize_to_tray), this, SLOT(minimizeToTray()))->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);
|
trayIconMenu->addAction(lang(lng_quit_from_tray), this, SLOT(quitFromTray()))->setEnabled(true);
|
||||||
}
|
}
|
||||||
psUpdateWorkmode();
|
psUpdateWorkmode();
|
||||||
|
@ -1047,17 +1047,20 @@ void Window::updateTrayMenu(bool force) {
|
||||||
QString notificationItem = lang(cDesktopNotify()
|
QString notificationItem = lang(cDesktopNotify()
|
||||||
? lng_disable_notifications_from_tray : lng_enable_notifications_from_tray);
|
? lng_disable_notifications_from_tray : lng_enable_notifications_from_tray);
|
||||||
|
|
||||||
QAction *first = trayIconMenu->actions().at(0);
|
|
||||||
first->setText(notificationItem);
|
|
||||||
if (cPlatform() == dbipWindows || cPlatform() == dbipMac) {
|
if (cPlatform() == dbipWindows || cPlatform() == dbipMac) {
|
||||||
QAction *second = trayIconMenu->actions().at(1);
|
QAction *toggle = trayIconMenu->actions().at(0);
|
||||||
second->setText(lang(active ? lng_minimize_to_tray : lng_open_from_tray));
|
disconnect(toggle, SIGNAL(triggered(bool)), this, SLOT(minimizeToTray()));
|
||||||
disconnect(second, SIGNAL(triggered(bool)), 0, 0);
|
disconnect(toggle, SIGNAL(triggered(bool)), this, SLOT(showFromTray()));
|
||||||
connect(second, SIGNAL(triggered(bool)), this, active ? SLOT(minimizeToTray()) : SLOT(showFromTray()));
|
connect(toggle, SIGNAL(triggered(bool)), this, active ? SLOT(minimizeToTray()) : SLOT(showFromTray()));
|
||||||
} else {
|
toggle->setText(lang(active ? lng_minimize_to_tray : lng_open_from_tray));
|
||||||
QAction *third = trayIconMenu->actions().at(2);
|
|
||||||
third->setDisabled(!isVisible());
|
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
|
#ifndef Q_OS_WIN
|
||||||
if (trayIcon) {
|
if (trayIcon) {
|
||||||
trayIcon->setContextMenu((active || cPlatform() != dbipMac) ? trayIconMenu : 0);
|
trayIcon->setContextMenu((active || cPlatform() != dbipMac) ? trayIconMenu : 0);
|
||||||
|
|
Loading…
Reference in New Issue