comparison libgui/qterminal/libqterminal/unix/TerminalView.cpp @ 29054:226df400639c

maint: merge stable to default.
author John W. Eaton <jwe@octave.org>
date Thu, 12 Nov 2020 02:02:39 -0500
parents 7d9a11de251f 440ace36950e
children 843b1f794544
comparison
equal deleted inserted replaced
29046:cde4b1d9f6ef 29054:226df400639c
2049 SLOT(tripleClickTimeout())); 2049 SLOT(tripleClickTimeout()));
2050 } 2050 }
2051 2051
2052 void TerminalView::wheelEvent( QWheelEvent* ev ) 2052 void TerminalView::wheelEvent( QWheelEvent* ev )
2053 { 2053 {
2054 #if defined (HAVE_QWHEELEVENT_ANGLEDELTA)
2055 if (ev->angleDelta().y() == 0)
2056 return;
2057 #else
2054 if (ev->orientation() != Qt::Vertical) 2058 if (ev->orientation() != Qt::Vertical)
2055 return; 2059 return;
2060 #endif
2056 2061
2057 if ( _mouseMarks ) 2062 if ( _mouseMarks )
2058 _scrollBar->event(ev); 2063 _scrollBar->event(ev);
2059 else 2064 else
2060 { 2065 {
2061 int charLine; 2066 int charLine;
2062 int charColumn; 2067 int charColumn;
2063 getCharacterPosition( ev->pos() , charLine , charColumn ); 2068 #if defined (HAVE_QWHEELEVENT_POSITION)
2064 2069 QPoint pos = ev->position().toPoint();
2065 emit mouseSignal( ev->delta() > 0 ? 4 : 5, 2070 #else
2071 QPoint pos = ev->pos();
2072 #endif
2073 getCharacterPosition( pos , charLine , charColumn );
2074
2075 #if defined (HAVE_QWHEELEVENT_ANGLEDELTA)
2076 int delta = ev->angleDelta().y();
2077 #else
2078 int delta = ev->delta();
2079 #endif
2080 emit mouseSignal( delta > 0 ? 4 : 5,
2066 charColumn + 1, 2081 charColumn + 1,
2067 charLine + 1 +_scrollBar->value() -_scrollBar->maximum() , 2082 charLine + 1 +_scrollBar->value() -_scrollBar->maximum() ,
2068 0); 2083 0);
2069 } 2084 }
2070 } 2085 }