File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
widgets/listing/listingtextview Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -170,9 +170,21 @@ void ListingTextWidget::wheelEvent(QWheelEvent *event)
170
170
if (m_surface)
171
171
{
172
172
QPoint ndegrees = event->angleDelta () / 8 ;
173
- QPoint nsteps = ndegrees / 15 ;
174
- auto offset = -nsteps.y () * DOCUMENT_WHEEL_UNIT;
175
- m_surface->scroll (m_surface->firstAddress () + offset, nsteps.x ());
173
+
174
+ if (!ndegrees.isNull ())
175
+ {
176
+ rd_offset offset = RD_NVAL;
177
+ int ncols = 0 ;
178
+
179
+ if (ndegrees.y () > 0 ) offset = m_surface->firstAddress () -DOCUMENT_WHEEL_UNIT;
180
+ else if (ndegrees.y () < 0 ) offset = m_surface->firstAddress () + DOCUMENT_WHEEL_UNIT;
181
+
182
+ if (ndegrees.x () > 0 ) ncols = -1 ;
183
+ else if (ndegrees.x () < 0 ) ncols = 1 ;
184
+
185
+ m_surface->scroll (offset, ncols);
186
+ }
187
+
176
188
event->accept ();
177
189
return ;
178
190
}
You can’t perform that action at this time.
0 commit comments