introduce SCROLLING options for Tasks

--the user can now adjust the Scrolling options
for its Tasks when the items overflow. The following
are provided:
Scrolling: ENABLE/DISABLE
--Manual Scrolling: DISABLE/PARALLEL/HORIZONTALANDVERTICAL
--Auto Scrolling: ENABLE/DISABLE

BUG: 407779
pull/6/head
Michail Vourlakos 6 years ago
parent 4dd93f3ba8
commit 74772cd7a9

@ -324,9 +324,20 @@
<entry name="mouseWheelActions" type="Bool">
<default>true</default>
</entry>
<entry name="scrollingTasksEnabled" type="Bool">
<entry name="scrollTasksEnabled" type="Bool">
<default>false</default>
</entry>
<entry name="autoScrollTasksEnabled" type="Bool">
<default>true</default>
</entry>
<entry name="manualScrollTasksType" type="Enum">
<choices>
<choice name="Disabled"/>
<choice name="Parallel"/>
<choice name="VerticalHorizontal"/>
</choices>
<default>1</default>
</entry>
<entry name="unifiedGlobalShortcuts" type="Bool">
<default>true</default>
<label>Global Shortcuts are combined between applets and tasks</label>

@ -420,7 +420,10 @@ Item {
property bool showAudioBadge: plasmoid.configuration.showAudioBadge
property bool audioBadgeActionsEnabled: plasmoid.configuration.audioBadgeActionsEnabled
property bool scrollingTasksEnabled: plasmoid.configuration.scrollingTasksEnabled
property bool scrollTasksEnabled: plasmoid.configuration.scrollTasksEnabled
property bool autoScrollTasksEnabled: plasmoid.configuration.autoScrollTasksEnabled
property int manualScrollTasksType: plasmoid.configuration.manualScrollTasksType
property bool showWindowActions: plasmoid.configuration.showWindowActions
property bool showWindowsOnlyFromLaunchers: plasmoid.configuration.showWindowsOnlyFromLaunchers
property bool showOnlyCurrentScreen: plasmoid.configuration.showOnlyCurrentScreen

@ -107,6 +107,14 @@ public:
};
Q_ENUM(ClickAction);
enum ManualScrollType
{
ManualScrollDisabled = 0,
ManualScrollOnlyParallel,
ManualScrollVerticalHorizontal
};
Q_ENUM(ManualScrollType);
enum ScrollAction
{
ScrollNone = 0,

@ -169,7 +169,10 @@ Item {
property bool mouseWheelActions: latteView ? latteView.mouseWheelActions : true
property bool parabolicEffectEnabled: latteView ? latteView.parabolicEffectEnabled : zoomFactor>1 && !root.editMode
property bool scrollingEnabled: latteView ? latteView.scrollingTasksEnabled : false
property bool scrollingEnabled: latteView ? latteView.scrollTasksEnabled : false
property bool autoScrollTasksEnabled: latteView ? (scrollingEnabled && latteView.autoScrollTasksEnabled) : false
property bool manualScrollTasksEnabled: latteView ? (scrollingEnabled && manualScrollTasksType !== Latte.Types.ManualScrollDisabled) : Latte.Types.ManualScrollDisabled
property int manualScrollTasksType: latteView ? latteView.manualScrollTasksType : 0
property bool showInfoBadge: latteView ? latteView.showInfoBadge : plasmoid.configuration.showInfoBadge
property bool showProgressBadge: latteView ? latteView.showProgressBadge : plasmoid.configuration.showInfoBadge

@ -622,7 +622,9 @@ MouseArea{
}
}
scrollableList.autoScrollFor(taskItem);
if (root.autoScrollTasksEnabled) {
scrollableList.autoScrollFor(taskItem);
}
if (root.latteView && root.latteView.isHalfShown) {
return;
@ -853,25 +855,43 @@ MouseArea{
}
}
onWheel: {
if (isSeparator || !root.mouseWheelActions || wheelIsBlocked || inBouncingAnimation
onWheel: {
if (isSeparator
|| wheelIsBlocked
|| !(root.mouseWheelActions || manualScrollTasksEnabled)
|| inBouncingAnimation
|| (latteView && (latteView.dockIsHidden || latteView.inSlidingIn || latteView.inSlidingOut))){
return;
}
var angle = wheel.angleDelta.y / 8;
var angleVertical = wheel.angleDelta.y / 8;
var angleHorizontal = wheel.angleDelta.x / 8;
wheelIsBlocked = true;
scrollDelayer.start();
//positive direction
if (angle > 12) {
var verticalDirection = (Math.abs(angleVertical) > Math.abs(angleHorizontal));
var mainAngle = verticalDirection ? angleVertical : angleHorizontal;
var positiveDirection = (mainAngle > 12);
var negativeDirection = (mainAngle < -12);
var parallelScrolling = (verticalDirection && plasmoid.formFactor === PlasmaCore.Types.Vertical)
|| (!verticalDirection && plasmoid.formFactor === PlasmaCore.Types.Horizontal);
if (positiveDirection) {
slotPublishGeometries();
if (root.scrollingEnabled && scrollableList.contentsExceed) {
var overflowScrollingAccepted = (root.manualScrollTasksEnabled
&& scrollableList.contentsExceed
&& (root.manualScrollTasksType === Latte.Types.ManualScrollVerticalHorizontal
|| (root.manualScrollTasksType === Latte.Types.ManualScrollOnlyParallel && parallelScrolling)) );
if (overflowScrollingAccepted) {
scrollableList.increasePos();
} else {
} else if (root.mouseWheelActions){
if (isLauncher || root.disableAllWindowsFunctionality) {
wrapper.runLauncherAnimation();
} else if (isGroupParent) {
@ -888,13 +908,18 @@ MouseArea{
hidePreviewWindow();
}
} else if (angle < -12) {
} else if (negativeDirection) {
slotPublishGeometries();
//negative direction
if (root.scrollingEnabled && scrollableList.contentsExceed) {
var overflowScrollingAccepted = (root.manualScrollTasksEnabled
&& scrollableList.contentsExceed
&& (root.manualScrollTasksType === Latte.Types.ManualScrollVerticalHorizontal
|| (root.manualScrollTasksType === Latte.Types.ManualScrollOnlyParallel && parallelScrolling)) );
if (overflowScrollingAccepted) {
scrollableList.decreasePos();
} else {
} else if (root.mouseWheelActions){
if (isLauncher || root.disableAllWindowsFunctionality) {
// do nothing
} else if (isGroupParent) {

@ -160,7 +160,7 @@ Flickable{
//! at the view boundaries, parabolic effect AND autoscroll at the
//! boundaries create animation breakage
if (!contentsExceed || root.tasksCount < 3
if (!root.autoScrollTasksEnabled || !contentsExceed || root.tasksCount < 3
|| (task.itemIndex===parabolicManager.lastRealTaskIndex && root.zoomFactor>1)) {
//last task with parabolic effect breaks the autoscolling behavior
return;

@ -132,18 +132,6 @@ PlasmaComponents.Page {
}
}
LatteComponents.CheckBox {
Layout.maximumWidth: dialog.optionsWidth
text: i18n("Support scrolling when items overflow")
checked: plasmoid.configuration.scrollingTasksEnabled
tooltip: i18n("When items overflow the user is able to scroll between them.\nTake note that automatic icon decrease mechanism will be disabled.")
visible: dialog.highLevel
onClicked: {
plasmoid.configuration.scrollingTasksEnabled = !plasmoid.configuration.scrollingTasksEnabled;
}
}
LatteComponents.CheckBox {
id: windowActionsChk
Layout.maximumWidth: dialog.optionsWidth
@ -325,6 +313,88 @@ PlasmaComponents.Page {
}
//! END: Launchers Group
//! BEGIN: Scrolling
ColumnLayout {
spacing: units.smallSpacing
visible: dialog.expertLevel
LatteComponents.HeaderSwitch {
id: scrollingHeader
Layout.minimumWidth: dialog.optionsWidth + 2 *units.smallSpacing
Layout.maximumWidth: Layout.minimumWidth
Layout.minimumHeight: implicitHeight
Layout.bottomMargin: units.smallSpacing
enabled: Latte.WindowSystem.compositingActive
checked: plasmoid.configuration.scrollTasksEnabled
text: i18n("Scrolling")
tooltip: i18n("Enable tasks scrolling when they overflow and exceed the available space");
onPressed: {
plasmoid.configuration.scrollTasksEnabled = !plasmoid.configuration.scrollTasksEnabled;;
}
}
ColumnLayout {
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: 0
enabled: scrollingHeader.checked
GridLayout {
columns: 2
Layout.minimumWidth: dialog.optionsWidth
Layout.maximumWidth: Layout.minimumWidth
Layout.topMargin: units.smallSpacing
PlasmaComponents.Label {
Layout.fillWidth: true
text: i18n("Manual")
}
LatteComponents.ComboBox {
id: manualScrolling
Layout.minimumWidth: leftClickAction.width
Layout.maximumWidth: leftClickAction.width
model: [i18nc("disabled manual scrolling", "Disabled scrolling"),
dialog.panelIsVertical ? i18n("Only vertical scrolling") : i18n("Only horizontal scrolling"),
i18n("Horizonal and vertical scrolling")]
currentIndex: plasmoid.configuration.manualScrollTasksType
onCurrentIndexChanged: plasmoid.configuration.manualScrollTasksType = currentIndex;
}
PlasmaComponents.Label {
id: autoScrollText
Layout.fillWidth: true
text: i18n("Automatic")
}
LatteComponents.ComboBox {
id: autoScrolling
Layout.minimumWidth: leftClickAction.width
Layout.maximumWidth: leftClickAction.width
model: [
i18n("Disabled"),
i18n("Enabled")
]
currentIndex: plasmoid.configuration.autoScrollTasksEnabled
onCurrentIndexChanged: {
if (currentIndex === 0) {
plasmoid.configuration.autoScrollTasksEnabled = false;
} else {
plasmoid.configuration.autoScrollTasksEnabled = true;
}
}
}
}
}
}
//! END: Scolling
//! BEGIN: Actions
ColumnLayout {
spacing: units.smallSpacing
@ -348,6 +418,7 @@ PlasmaComponents.Page {
enabled: !disableAllWindowsFunctionality
PlasmaComponents.Label {
id: leftClickLbl
text: i18n("Left Click")
}

Loading…
Cancel
Save