summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-11-04 15:33:28 (GMT)
committerSwift Review <review@swift.im>2014-11-06 13:24:57 (GMT)
commitc25d5ae09c2ec4cc6f18316f9aabe617404170a9 (patch)
tree589f2f0120ae45c80419c864e617eb4fe9209c67 /Swift/QtUI
parent19aac3507c575a3d039cd1e2e45f232ac2251aa8 (diff)
downloadswift-c25d5ae09c2ec4cc6f18316f9aabe617404170a9.zip
swift-c25d5ae09c2ec4cc6f18316f9aabe617404170a9.tar.bz2
Open context menu for the roster on menu key you find on Windows keyboards.
Test-Information: Tested on Windows 8.1. Change-Id: Iec6273023289f2da4de2f22cdbabd8a157830633
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/Roster/QtFilterWidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Swift/QtUI/Roster/QtFilterWidget.cpp b/Swift/QtUI/Roster/QtFilterWidget.cpp
index 64eb312..78949f2 100644
--- a/Swift/QtUI/Roster/QtFilterWidget.cpp
+++ b/Swift/QtUI/Roster/QtFilterWidget.cpp
@@ -66,7 +66,8 @@ bool QtFilterWidget::eventFilter(QObject*, QEvent* event) {
return false;
} else if (keyEvent->key() == Qt::Key_Alt && event->type() == QEvent::KeyPress) {
isModifierSinglePressed_ = true;
- } else if (keyEvent->key() == Qt::Key_Alt && event->type() == QEvent::KeyRelease && isModifierSinglePressed_) {
+ } else if ((keyEvent->key() == Qt::Key_Alt && event->type() == QEvent::KeyRelease && isModifierSinglePressed_)
+ || (keyEvent->key() == Qt::Key_Menu)) {
QPoint itemOffset(2,2);
QPoint contextMenuPosition = treeView_->visualRect(treeView_->currentIndex()).topLeft() + itemOffset;;
QApplication::postEvent(treeView_, new QContextMenuEvent(QContextMenuEvent::Keyboard, contextMenuPosition, treeView_->mapToGlobal(contextMenuPosition)));