mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 04:38:04 -06:00
Add horizontal scrolling for tracker list and torrent content
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include <QTreeWidgetItem>
|
||||
#include <QUrl>
|
||||
#include <QVector>
|
||||
#include <QWheelEvent>
|
||||
|
||||
#include "base/bittorrent/peerinfo.h"
|
||||
#include "base/bittorrent/session.h"
|
||||
@@ -683,3 +684,19 @@ void TrackerListWidget::displayColumnHeaderMenu()
|
||||
|
||||
menu->popup(QCursor::pos());
|
||||
}
|
||||
|
||||
void TrackerListWidget::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
if (event->modifiers() & Qt::ShiftModifier)
|
||||
{
|
||||
// Shift + scroll = horizontal scroll
|
||||
event->accept();
|
||||
QWheelEvent scrollHEvent {event->position(), event->globalPosition()
|
||||
, event->pixelDelta(), event->angleDelta().transposed(), event->buttons()
|
||||
, event->modifiers(), event->phase(), event->inverted(), event->source()};
|
||||
QTreeView::wheelEvent(&scrollHEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
QTreeView::wheelEvent(event); // event delegated to base class
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user