mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
Don't switch pages when right-clicking on list
This commit is contained in:
parent
7281e8b888
commit
5ec97811d8
2 changed files with 15 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QContextMenuEvent>
|
#include <QContextMenuEvent>
|
||||||
|
#include <QMouseEvent>
|
||||||
|
|
||||||
#include "../../model/prefs/state.hpp"
|
#include "../../model/prefs/state.hpp"
|
||||||
|
|
||||||
|
@ -21,6 +22,17 @@ void CSVPrefs::ContextMenuList::contextMenuEvent(QContextMenuEvent* e)
|
||||||
delete menu;
|
delete menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVPrefs::ContextMenuList::mousePressEvent(QMouseEvent* e)
|
||||||
|
{
|
||||||
|
// enable all buttons except right click
|
||||||
|
// This means that when right-clicking to enable the
|
||||||
|
// context menu, the page doesn't switch at the same time.
|
||||||
|
if (!(e->buttons() & Qt::RightButton))
|
||||||
|
{
|
||||||
|
QListWidget::mousePressEvent(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CSVPrefs::ContextMenuList::resetCategory()
|
void CSVPrefs::ContextMenuList::resetCategory()
|
||||||
{
|
{
|
||||||
CSMPrefs::State::get().resetCategory(currentItem()->text().toStdString());
|
CSMPrefs::State::get().resetCategory(currentItem()->text().toStdString());
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
|
|
||||||
class QContextMenuEvent;
|
class QContextMenuEvent;
|
||||||
|
class QMouseEvent;
|
||||||
|
|
||||||
namespace CSVPrefs
|
namespace CSVPrefs
|
||||||
{
|
{
|
||||||
|
@ -19,6 +20,8 @@ namespace CSVPrefs
|
||||||
|
|
||||||
void contextMenuEvent(QContextMenuEvent* e);
|
void contextMenuEvent(QContextMenuEvent* e);
|
||||||
|
|
||||||
|
void mousePressEvent(QMouseEvent* e);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void resetCategory();
|
void resetCategory();
|
||||||
|
|
Loading…
Reference in a new issue