custom context menus (including tray menu for windows) done

This commit is contained in:
John Preston
2014-09-28 19:47:30 -07:00
parent a4e9dadc2d
commit 0d85f91453
28 changed files with 375 additions and 126 deletions
+2 -2
View File
@@ -1038,7 +1038,7 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
AudioLink *lnkAudio = dynamic_cast<AudioLink*>(_contextMenuLnk.data());
DocumentLink *lnkDocument = dynamic_cast<DocumentLink*>(_contextMenuLnk.data());
if (lnkPhoto || lnkVideo || lnkAudio || lnkDocument) {
_menu = new QMenu(_overview);
_menu = new ContextMenu(_overview);
if (App::hoveredLinkItem()) {
_menu->addAction(lang(lng_context_to_msg), this, SLOT(goToMessage()))->setEnabled(true);
}
@@ -1068,7 +1068,7 @@ void OverviewInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
App::contextItem(App::hoveredLinkItem());
}
if (_menu) {
_menu->setAttribute(Qt::WA_DeleteOnClose);
_menu->deleteOnHide();
connect(_menu, SIGNAL(destroyed(QObject*)), this, SLOT(onMenuDestroy(QObject*)));
_menu->popup(e->globalPos());
e->accept();