Fixed deprecated method QWheelEvent::delta (#2647)
Reference: https://doc.qt.io/qt-5/qwheelevent-obsolete.html#delta and https://doc.qt.io/qt-5/qwheelevent-obsolete.html#orientation Changes in behavior introduced in this commit Change from `event->delta()` to `event->angleDelta().y()` makes it, so you can no longer scroll horizontally (with trackpad / touchpad) to select next/previous tab (until now, you were able to do it, but I believe this is wrong anyways). Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -1110,8 +1110,10 @@ void ChannelView::drawMessages(QPainter &painter)
|
||||
|
||||
void ChannelView::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
if (event->orientation() != Qt::Vertical)
|
||||
if (!event->angleDelta().y())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event->modifiers() & Qt::ControlModifier)
|
||||
{
|
||||
@@ -1124,7 +1126,7 @@ void ChannelView::wheelEvent(QWheelEvent *event)
|
||||
float mouseMultiplier = getSettings()->mouseScrollMultiplier;
|
||||
|
||||
qreal desired = this->scrollBar_->getDesiredValue();
|
||||
qreal delta = event->delta() * qreal(1.5) * mouseMultiplier;
|
||||
qreal delta = event->angleDelta().y() * qreal(1.5) * mouseMultiplier;
|
||||
|
||||
auto snapshot = this->getMessagesSnapshot();
|
||||
int snapshotLength = int(snapshot.size());
|
||||
|
||||
Reference in New Issue
Block a user