[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    D6392: [Panel Config] Scrolling over size button increments size by 1 and shows current thickness
From:       Chris Holland <noreply () phabricator ! kde ! org>
Date:       2018-01-03 18:10:05
Message-ID: 20180103181005.1.915BD915908AD55D () phabricator ! kde ! org
[Download RAW message or body]

Zren added inline comments.

INLINE COMMENTS

> broulik wrote in SizeHandle.qml:123
> I don't know exactly how `MouseEventListener` behaves but in `MouseArea` you get a \
> ton of `onWheel` events for touchpads (which scroll pixel-precisely), potentially \
> causing you to making your panel enormous accidentally

Recently got a Windows Vista era HP laptop running KDE.
I see, the touchpad "mousewheel" sends a ton of events with `wheel.delta` from  ±9 to \
±60.

In my test, I actually noticed the opposite effect (it was slow to resize) since we \
do `Math.round(wheel.delta / 120)` which can turn into `Math.round(30 / 120) = 0`. So \
events with a `wheel.delta` smaller than 60 were ignored.

Anyways, I always wondered why plasma-pa did this in their mousewheel code:

https://github.com/KDE/plasma-pa/blob/master/applet/contents/ui/main.qml#L197-L210

Should be an easy fix. Just need to add a `wheelDelta` variable and ignore events \
when it's `wheelDelta <= -120 || 120 <= wheelDelta`.

REPOSITORY
  R119 Plasma Desktop

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

To: Zren, #plasma
Cc: davidedmundson, broulik, plasma-devel, ZrenBot, progwolff, lesliezhai, \
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart


[Attachment #3 (unknown)]

<table><tr><td style="">Zren added inline comments.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: \
right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: \
#F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: \
inline-block; border: 1px solid rgba(71,87,120,.2);" \
href="https://phabricator.kde.org/D6392" rel="noreferrer">View \
Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div \
style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: \
3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; \
border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; \
background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; \
text-decoration: none;" href="https://phabricator.kde.org/D6392#inline-26336" \
rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: \
bold;">broulik</span> wrote in <span style="color: #4b4d51; font-weight: \
bold;">SizeHandle.qml:123</span></div> <div style="margin: 8px 0; padding: 0 12px; \
color: #74777D;"><p style="padding: 0; margin: 8px;">I don&#039;t know exactly how \
<tt style="background: #ebebeb; font-size: 13px;">MouseEventListener</tt> behaves but \
in <tt style="background: #ebebeb; font-size: 13px;">MouseArea</tt> you get a ton of \
<tt style="background: #ebebeb; font-size: 13px;">onWheel</tt> events for touchpads \
(which scroll pixel-precisely), potentially causing you to making your panel enormous \
accidentally</p></div></div> <div style="margin: 8px 0; padding: 0 12px;"><p \
style="padding: 0; margin: 8px;">Recently got a Windows Vista era HP laptop running \
KDE.<br /> I see, the touchpad &quot;mousewheel&quot; sends a ton of events with <tt \
style="background: #ebebeb; font-size: 13px;">wheel.delta</tt> from  ±9 to  ±60.</p>

<p style="padding: 0; margin: 8px;">In my test, I actually noticed the opposite \
effect (it was slow to resize) since we do <tt style="background: #ebebeb; font-size: \
13px;">Math.round(wheel.delta / 120)</tt> which can turn into <tt style="background: \
#ebebeb; font-size: 13px;">Math.round(30 / 120) = 0</tt>. So events with a <tt \
style="background: #ebebeb; font-size: 13px;">wheel.delta</tt> smaller than 60 were \
ignored.</p>

<p style="padding: 0; margin: 8px;">Anyways, I always wondered why plasma-pa did this \
in their mousewheel code:</p>

<p style="padding: 0; margin: 8px;"><a \
href="https://github.com/KDE/plasma-pa/blob/master/applet/contents/ui/main.qml#L197-L210" \
class="remarkup-link" target="_blank" \
rel="noreferrer">https://github.com/KDE/plasma-pa/blob/master/applet/contents/ui/main.qml#L197-L210</a></p>


<p style="padding: 0; margin: 8px;">Should be an easy fix. Just need to add a <tt \
style="background: #ebebeb; font-size: 13px;">wheelDelta</tt> variable and ignore \
events when it&#039;s <tt style="background: #ebebeb; font-size: 13px;">wheelDelta \
&lt;= -120 || 120 &lt;= wheelDelta</tt>.</p></div></div></div></div></div><br \
/><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></div></div><br \
/><div><strong>REVISION DETAIL</strong><div><a \
href="https://phabricator.kde.org/D6392" \
rel="noreferrer">https://phabricator.kde.org/D6392</a></div></div><br \
/><div><strong>To: </strong>Zren, Plasma<br /><strong>Cc: </strong>davidedmundson, \
broulik, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, \
abetts, sebas, apol, mart<br /></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic