mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-12 16:20:25 +08:00
Improved CDockAreaTabBar::wheelEvent to use pixelDelta() if available (i.e. on Mac) and fall back to angleDelta() if not
This commit is contained in:
parent
f2378636e2
commit
224676836d
@ -161,15 +161,13 @@ CDockAreaTabBar::~CDockAreaTabBar()
|
|||||||
void CDockAreaTabBar::wheelEvent(QWheelEvent* Event)
|
void CDockAreaTabBar::wheelEvent(QWheelEvent* Event)
|
||||||
{
|
{
|
||||||
Event->accept();
|
Event->accept();
|
||||||
const int direction = Event->angleDelta().y();
|
int numPixels = Event->pixelDelta().y();
|
||||||
if (direction < 0)
|
if (!numPixels)
|
||||||
{
|
{
|
||||||
horizontalScrollBar()->setValue(horizontalScrollBar()->value() + 20);
|
numPixels = Event->angleDelta().y() / 5;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
horizontalScrollBar()->setValue(horizontalScrollBar()->value() - 20);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
horizontalScrollBar()->setValue(horizontalScrollBar()->value() - numPixels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user