diff options
author | Sky <git@bunnies.cc> | 2014-03-16 21:04:36 +0000 |
---|---|---|
committer | Sky <git@bunnies.cc> | 2014-03-16 21:04:36 +0000 |
commit | c33e5ca62e57c16bf60ca294b3edc437fd35ba44 (patch) | |
tree | 597f0110ccb04d8e2c81808995b4ffd700196cf7 /gui | |
parent | de2eb3fc5404cbbfd438919c250885e5e8450a82 (diff) | |
parent | 00a945d84b59d6469e0c85335dc0ad4067d9f2ab (diff) | |
download | MultiMC-c33e5ca62e57c16bf60ca294b3edc437fd35ba44.tar MultiMC-c33e5ca62e57c16bf60ca294b3edc437fd35ba44.tar.gz MultiMC-c33e5ca62e57c16bf60ca294b3edc437fd35ba44.tar.lz MultiMC-c33e5ca62e57c16bf60ca294b3edc437fd35ba44.tar.xz MultiMC-c33e5ca62e57c16bf60ca294b3edc437fd35ba44.zip |
Merge pull request #153 from Drayshak/develop
Better right-click behaviour, context menu on mouse-up instead of down, fixes #151
Diffstat (limited to 'gui')
-rw-r--r-- | gui/MainWindow.cpp | 2 | ||||
-rw-r--r-- | gui/groupview/GroupView.cpp | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index 17d4630b..3ab93ba9 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -177,7 +177,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi view->setFrameShape(QFrame::NoFrame); view->setModel(proxymodel); - view->setContextMenuPolicy(Qt::CustomContextMenu); + //view->setContextMenuPolicy(Qt::CustomContextMenu); connect(view, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(showInstanceContextMenu(const QPoint &))); diff --git a/gui/groupview/GroupView.cpp b/gui/groupview/GroupView.cpp index b650efee..342e2523 100644 --- a/gui/groupview/GroupView.cpp +++ b/gui/groupview/GroupView.cpp @@ -380,6 +380,14 @@ void GroupView::mouseReleaseEvent(QMouseEvent *event) bool click = (index == m_pressedIndex && index.isValid()) || (m_pressedCategory && m_pressedCategory == categoryAt(geometryPos)); + bool isRight = event->button() == Qt::RightButton; + + if((index == m_pressedIndex && index.isValid()) && isRight) + { + emit customContextMenuRequested(event->pos()); + return; + } + if (click && m_pressedCategory) { if (state() == ExpandingState) |