Mercurial > octave
diff libgui/src/documentation.cc @ 25985:49ffd0e0242d
enable resetting doc browser zoom level even when zooming with mouse wheel
* documentation.cc (documentation_browser::wheelEvent): reimplement
mouse wheel event and, in case of active control modifier, call own
zooming function which are keeping track of the zoom level
* documentation.h: new protected method for reimplemented wheel event
author | Torsten <mttl@mailbox.org> |
---|---|
date | Tue, 30 Oct 2018 22:50:40 +0100 |
parents | a7cc5b7a3d22 |
children | 390d59717711 |
line wrap: on
line diff
--- a/libgui/src/documentation.cc Tue Oct 30 14:34:57 2018 -0700 +++ b/libgui/src/documentation.cc Tue Oct 30 22:50:40 2018 +0100 @@ -614,4 +614,20 @@ zoomIn (- m_zoom_level); m_zoom_level = 0; } -} + + void documentation_browser::wheelEvent (QWheelEvent *we) + { + if (we->modifiers () == Qt::ControlModifier) + { + if (we->delta () > 0) + zoom_in (); + else + zoom_out (); + + we->accept (); + } + else + QTextEdit::wheelEvent (we); + } + +} \ No newline at end of file