Bug 379498

Summary: Expose a user-facing setting to change QStyle::SH_ScrollBar_LeftClickAbsolutePosition
Product: [Applications] systemsettings Reporter: Nate Graham <nate>
Component: kcm_styleAssignee: Nate Graham <nate>
Status: RESOLVED FIXED    
Severity: wishlist CC: aria, ascaris, bfeber, bugseforuns, hugo.pereira.da.costa, jplx256, mountybike, nate, nfxjfg, tempel.julian
Priority: NOR Keywords: usability
Version: 5.9.5   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=402578
https://bugs.kde.org/show_bug.cgi?id=384889
https://bugs.kde.org/show_bug.cgi?id=412685
Latest Commit: Version Fixed In: 5.18.0
Sentry Crash Report:

Description Nate Graham 2017-05-04 03:29:47 UTC
Linux Distro: openSUSE Tumbleweed
Plasma version: 5.9.5
Breeze version: 5.9.5

I prefer the scrollbar style where left-clicking on the scroll track jumps the bar to that location (i.e. the current behavior for a middle-click). To get this behavior in GTK programs, I can set "gtk-primary-button-warps-slider=1" in ~/.config/gtk-3.0/settings.ini. For QT programs, the equivalent setting is QStyle::SH_ScrollBar_LeftClickAbsolutePosition, but Breeze doesn't expose that setting in the GUI, at System Settings > Widget Style > Scrollbars.
Comment 1 Christoph Feck 2017-05-04 09:41:37 UTC
But middle click works?
Comment 2 Hugo Pereira Da Costa 2017-05-04 09:43:37 UTC
(In reply to Christoph Feck from comment #1)
> But middle click works?

here yes, at least
Comment 3 Nate Graham 2017-05-04 13:11:34 UTC
Yes, it does. I just prefer having the scroll bar move with a left-click in the trough, not a middle-click. Middle-clicking is annoying with a touchpad, which is what I'm using 95% of the time.
Comment 4 Hugo Pereira Da Costa 2017-05-04 13:53:40 UTC
(In reply to Christoph Feck from comment #1)
> But middle click works?

I wonder if this should not be added to upstream "kstyle" rather than breeze.
It is not really a style specific feature, is it? 
And this way both oxygen and breeze (and any other kstyle derived widget style) would benefit from the extra option.
We could then add the extra option not to breeze configuration but rather to the "Fine tuning" tab of the widget style kcm.

wdyt ?
Comment 5 Nate Graham 2017-05-04 15:37:26 UTC
That's an excellent idea! You're right, this isn't really Breeze-specific.
Comment 6 Nate Graham 2017-11-28 14:03:08 UTC
*** Bug 387363 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2018-08-30 16:36:51 UTC
*** Bug 398067 has been marked as a duplicate of this bug. ***
Comment 8 tempel.julian 2018-09-18 15:58:35 UTC
I really would love to have the ability to jump to the scrollbar position also with primary mouse button (not middle mouse button) in Qt applications.
Comment 9 Nate Graham 2018-11-19 20:40:44 UTC
*** Bug 401219 has been marked as a duplicate of this bug. ***
Comment 10 Christoph Feck 2019-06-07 12:26:57 UTC
*** Bug 408409 has been marked as a duplicate of this bug. ***
Comment 11 Nate Graham 2019-10-04 19:37:38 UTC
I should finally do this.
Comment 12 Björn Feber 2019-10-04 19:41:55 UTC
(In reply to Nate Graham from comment #11)
> I should finally do this.

The GTK KCM already has this, so when the Application Style KCM has it too and we have the GTK settings synchronization structure then we can set that option for GTK there too.
Comment 13 Nate Graham 2019-10-04 20:06:52 UTC
Yeah. Though upon reflection, I'm gonna put it in the General Behavior rather than Application style since it will affect all scrollbars including in Plasma, which is not an application, so it doesn't make sense IMO to put it in a KCM that's explicitly only about apps.

Having started already, it looks like this actually may not be all that hard.
Comment 14 Nate Graham 2019-10-07 02:17:13 UTC
*** Bug 402218 has been marked as a duplicate of this bug. ***
Comment 15 Nate Graham 2019-11-17 23:55:32 UTC
Here's a patch that implements this feature for Qt/KDE apps at least: https://phabricator.kde.org/D25361

Other patches will be required to get scrollbars in Plasma (Bug 384889) and QML-based desktop apps (Bug 412685) to follow suit.
Comment 16 Nate Graham 2019-12-02 18:18:51 UTC
Git commit dcadc14c952df6a25a357dbaad16ebde15b438a8 by Nate Graham.
Committed on 02/12/2019 at 18:18.
Pushed by ngraham into branch 'master'.

Conditionally set SH_ScrollBar_LeftClickAbsolutePosition based on kdeglobals setting

Summary: CCBUG: 379498

Test Plan:
- Set `ScrollbarLeftClickNavigatesByPage=true` in the `[KDE]` section of ~/.config/kdeglobals
- Click in the scroll trough in a Qt/KDE app
- See that the scroll handle position jumps right there
- Set `ScrollbarLeftClickNavigatesByPage=false` or remove it from kdeglobals
- Click in the scroll trough in a Qt/KDE app
- See that the scroll handle moves up or down by one page height

Reviewers: #frameworks, #plasma

Subscribers: broulik, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D25360

M  +5    -0    src/kstyle/kstyle.cpp

https://commits.kde.org/frameworkintegration/dcadc14c952df6a25a357dbaad16ebde15b438a8
Comment 17 ariasuni 2019-12-02 23:26:45 UTC
Thank you! Can’t wait to see it fully implemented.
Comment 18 Nate Graham 2019-12-03 00:12:03 UTC
You're very welcome!
Comment 19 tempel.julian 2020-02-14 13:59:26 UTC
Thanks, Nate! Plasma 5.18 really comes with handy changes.
Comment 20 Nate Graham 2020-02-14 14:03:17 UTC
You're welcome!
Comment 21 tempel.julian 2020-02-16 10:52:31 UTC
Huh, it works in Okular, but for whatever reason not in LibreOffice Writer with kde5 VCL. There only middle mouse button jumps directly to the position, left mouse button doesn't.
Comment 22 ariasuni 2020-02-16 11:30:44 UTC
I can confirm it works in KDE Applications, VLC, Firefox, Thunderbird, but not in LibreOffice.
Comment 23 Nate Graham 2020-02-16 17:28:56 UTC
That's a bug in LibreOffice. Please file a bug for them, telling them that when using the KDE5 VCL, they should respect QStyle::SH_ScrollBar_LeftClickAbsolutePosition. Then paste a link to the bug report here. :)
Comment 24 tempel.julian 2020-02-18 14:06:48 UTC
Done:
https://bugs.documentfoundation.org/show_bug.cgi?id=130758