D5037: KTextEditor: prevent accidental zooming

Dominik Haumann noreply at phabricator.kde.org
Mon Mar 13 21:09:43 UTC 2017


dhaumann added a comment.


  Thinking aloud: Can you factor this out into a small helper class called WheelEventFilter or similar? I can imagine this would be cleaner.
  The code possibly would shrink down to something like:
  
    if (m_wheelEventFilter.processEvent(event)) {
        // ... zoom in / out
        return;
    }

INLINE COMMENTS

> kateviewinternal.cpp:3301
> +    bool skip = false;
> +    qint64 deltaT = m_lastWheelEvent.elapsed();
> +    Qt::KeyboardModifiers modState = e->modifiers();

const qint64 ...

> kateviewinternal.cpp:3331
> +    // ctrl pressed -> change font size (only if angle is reported and not accidentally so)
> +    // NB: if the ControlModifier is not unset at this point we'd get accelerated scrolling.
> +    if (!skip && modState == Qt::ControlModifier) {

Note: instead of NB (had to look it up)

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D5037

To: rjvbb, #ktexteditor
Cc: dhaumann, kwrite-devel, #ktexteditor, #frameworks, head7, cullmann, kfunk, sars
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170313/86ce2f3a/attachment.html>


More information about the Kde-frameworks-devel mailing list