mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-30 00:55:16 +01:00
fixed #427
This commit is contained in:
parent
e233deb549
commit
a7410954a4
@ -26,7 +26,8 @@
|
||||
#include <QTimer>
|
||||
#include <QTimer>
|
||||
|
||||
MessagesView::MessagesView(QWidget* parent) : QTreeView(parent), m_contextMenu(nullptr), m_columnsAdjusted(false) {
|
||||
MessagesView::MessagesView(QWidget* parent)
|
||||
: QTreeView(parent), m_contextMenu(nullptr), m_columnsAdjusted(false), m_processingMouse(false) {
|
||||
m_sourceModel = qApp->feedReader()->messagesModel();
|
||||
m_proxyModel = qApp->feedReader()->messagesProxyModel();
|
||||
|
||||
@ -276,7 +277,9 @@ void MessagesView::initializeContextMenu() {
|
||||
}
|
||||
|
||||
void MessagesView::mousePressEvent(QMouseEvent* event) {
|
||||
m_processingMouse = true;
|
||||
QTreeView::mousePressEvent(event);
|
||||
m_processingMouse = false;
|
||||
|
||||
switch (event->button()) {
|
||||
case Qt::MouseButton::LeftButton: {
|
||||
@ -347,7 +350,8 @@ void MessagesView::selectionChanged(const QItemSelection& selected, const QItemS
|
||||
emit currentMessageRemoved();
|
||||
}
|
||||
|
||||
if (qApp->settings()->value(GROUP(Messages), SETTING(Messages::KeepCursorInCenter)).toBool()) {
|
||||
if (!m_processingMouse &&
|
||||
qApp->settings()->value(GROUP(Messages), SETTING(Messages::KeepCursorInCenter)).toBool()) {
|
||||
scrollTo(currentIndex(), QAbstractItemView::ScrollHint::PositionAtCenter);
|
||||
}
|
||||
|
||||
|
@ -103,6 +103,7 @@ class MessagesView : public QTreeView {
|
||||
MessagesProxyModel* m_proxyModel;
|
||||
MessagesModel* m_sourceModel;
|
||||
bool m_columnsAdjusted;
|
||||
bool m_processingMouse;
|
||||
};
|
||||
|
||||
inline MessagesProxyModel* MessagesView::model() const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user