Commit 759cec46 authored by Nate Graham's avatar Nate Graham 🔩
Browse files

[Workspace KCM] Expose setting to choose what left-clicking in the scrollbar track does

Summary:
This patch exposes a UI for choosing what happens when you left-click in the scrollbar
track  in a Qt or KDE app. The default behavior is unchanged (left-click to page up/page
down) but now you can choose to warp the scroll handle straight to the clicked position.

Having this setting in the Workspace KCM opens the door to later making it also change
the behavior for GTK apps as well, allowing us to remove one more setting from the GTK
KCM and bringing us one step closer to finishing {T10611}.

BUG: 379498
FIXED-IN: 5.18.0

Depends on D25360

Test Plan:
{F7769005}

- Apply D25360
- Click on "Scrolls to the clicked location" in the KCM
- Click in the scrollbar track in a Qt/KDE app
- See that the scroll handle position jumps right there
- Click on  "Scrolls one page up or down" in the KCM
- Click in the scrollbar track in a Qt/KDE app
- See that the scroll handle moves up or down by one page height

Reviewers: #plasma, #vdg, ndavis

Reviewed By: #vdg, ndavis

Subscribers: GB_2, davidedmundson, ndavis, gikari, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D25361
parent 8f8fe2c2
/*
* Copyright 2018 Furkan Tokac <furkantokac34@gmail.com>
* Copyright (C) 2019 Nate Graham <nate@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -106,6 +107,8 @@ KCM.SimpleKCM {
// Click behavior settings
QQC2.ButtonGroup { id: singleClickGroup }
QQC2.RadioButton {
id: singleClick
Kirigami.FormData.label: i18n("Click behavior:")
......@@ -113,6 +116,7 @@ KCM.SimpleKCM {
enabled: !kcm.globalsSettings.isImmutable("singleClick")
checked: kcm.globalsSettings.singleClick
onToggled: kcm.globalsSettings.singleClick = true
QQC2.ButtonGroup.group: singleClickGroup
}
QQC2.RadioButton {
......@@ -121,7 +125,34 @@ KCM.SimpleKCM {
enabled: !kcm.globalsSettings.isImmutable("singleClick")
checked: !kcm.globalsSettings.singleClick
onToggled: kcm.globalsSettings.singleClick = false
QQC2.ButtonGroup.group: singleClickGroup
}
Item {
Kirigami.FormData.isSection: false
}
// scroll handle settings
QQC2.ButtonGroup { id: scrollHandleBehaviorGroup }
QQC2.RadioButton {
id: scrollbarLeftClickNavigatesByPage
Kirigami.FormData.label: i18n("Clicking in scrollbar track:")
text: i18nc("@radio part of a complete sentence: 'Clicking in scrollbar track scrolls one page up or down'", "Scrolls one page up or down")
enabled: !kcm.globalsSettings.isImmutable("scrollbarLeftClickNavigatesByPage")
checked: kcm.globalsSettings.scrollbarLeftClickNavigatesByPage
onToggled: kcm.globalsSettings.scrollbarLeftClickNavigatesByPage = true
QQC2.ButtonGroup.group: scrollHandleBehaviorGroup
}
QQC2.RadioButton {
id: scrollBarLeftClickWarpsScrollHandle
text: i18nc("@radio part of a complete sentence: 'Clicking in scrollbar track scrolls to the clicked location'", "Scrolls to the clicked location")
enabled: !kcm.globalsSettings.isImmutable("scrollbarLeftClickNavigatesByPage")
checked: !kcm.globalsSettings.scrollbarLeftClickNavigatesByPage
onToggled: kcm.globalsSettings.scrollbarLeftClickNavigatesByPage = false
QQC2.ButtonGroup.group: scrollHandleBehaviorGroup
}
}
}
......@@ -13,5 +13,9 @@
<label>Animation speed</label>
<default>1.0</default>
</entry>
<entry name="scrollbarLeftClickNavigatesByPage" key="ScrollbarLeftClickNavigatesByPage" type="Bool">
<label>Left-click in scrollbar track moves scrollbar by one page</label>
<default>true</default>
</entry>
</group>
</kcfg>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment