|
|
|
@ -35,7 +35,7 @@ import org.kde.latte.private.tasks 0.1 as LatteTasks
|
|
|
|
|
import "animations" as TaskAnimations
|
|
|
|
|
import "indicator" as Indicator
|
|
|
|
|
|
|
|
|
|
MouseArea{
|
|
|
|
|
Item {
|
|
|
|
|
id: taskItem
|
|
|
|
|
|
|
|
|
|
visible: false //true//(isStartup && animations.speedFactor.current !== 0) ? false : true
|
|
|
|
@ -97,9 +97,10 @@ MouseArea{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
acceptedButtons: Qt.LeftButton | Qt.MidButton | Qt.RightButton
|
|
|
|
|
hoverEnabled: visible && (!inAnimation) && (!IsStartup) && (!root.taskInAnimation)
|
|
|
|
|
&&(!inBouncingAnimation) && !isSeparator
|
|
|
|
|
property alias hoverEnabled: taskMouseArea.hoverEnabled
|
|
|
|
|
property alias containsMouse: taskMouseArea.containsMouse
|
|
|
|
|
property alias pressed: taskMouseArea.pressed
|
|
|
|
|
|
|
|
|
|
// hoverEnabled: false
|
|
|
|
|
//opacity : isSeparator && (hiddenSpacerLeft.neighbourSeparator || hiddenSpacerRight.neighbourSeparator) ? 0 : 1
|
|
|
|
|
|
|
|
|
@ -148,7 +149,6 @@ MouseArea{
|
|
|
|
|
|
|
|
|
|
property bool hoveredFromDragging: (mouseHandler.hoveredItem === taskItem) || (mouseHandler.ignoredItem === taskItem)
|
|
|
|
|
|
|
|
|
|
property bool pressed: false
|
|
|
|
|
property bool wheelIsBlocked: false
|
|
|
|
|
|
|
|
|
|
property int animationTime: (taskItem.animations.active ? taskItem.animations.speedFactor.current : 2) * (1.2 *taskItem.animations.duration.small)
|
|
|
|
@ -180,6 +180,7 @@ MouseArea{
|
|
|
|
|
property string launcherName: ""
|
|
|
|
|
|
|
|
|
|
readonly property alias hoveredTimer: _hoveredTimer
|
|
|
|
|
readonly property alias mouseArea: taskMouseArea
|
|
|
|
|
readonly property alias tooltipVisualParent: _wrapper.titleTooltipVisualParent
|
|
|
|
|
readonly property alias previewsVisualParent: _wrapper.previewsTooltipVisualParent
|
|
|
|
|
readonly property alias wrapper: _wrapper
|
|
|
|
@ -196,7 +197,7 @@ MouseArea{
|
|
|
|
|
property Item metrics: null
|
|
|
|
|
property Item parabolic: null
|
|
|
|
|
property Item requires: null
|
|
|
|
|
property Item shortcuts: null
|
|
|
|
|
property Item shortcuts: null
|
|
|
|
|
|
|
|
|
|
onModelLauncherUrlChanged: {
|
|
|
|
|
if (modelLauncherUrl !== ""){
|
|
|
|
@ -558,7 +559,7 @@ MouseArea{
|
|
|
|
|
active: taskItem.parabolic.isEnabled
|
|
|
|
|
width: root.isHorizontal ? taskItem.width : taskItem.metrics.mask.thickness.zoomedForItems
|
|
|
|
|
height: root.isHorizontal ? taskItem.metrics.mask.thickness.zoomedForItems : taskItem.height
|
|
|
|
|
|
|
|
|
|
z:10000
|
|
|
|
|
sourceComponent: ParabolicArea{}
|
|
|
|
|
|
|
|
|
|
states:[
|
|
|
|
@ -678,288 +679,299 @@ MouseArea{
|
|
|
|
|
|
|
|
|
|
///////////////// Mouse Area Events ///////////////////
|
|
|
|
|
|
|
|
|
|
onEntered: {
|
|
|
|
|
if (isLauncher && windowsPreviewDlg.visible) {
|
|
|
|
|
windowsPreviewDlg.hide(1);
|
|
|
|
|
}
|
|
|
|
|
MouseArea {
|
|
|
|
|
id: taskMouseArea
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
acceptedButtons: Qt.LeftButton | Qt.MidButton | Qt.RightButton
|
|
|
|
|
hoverEnabled: visible && (!inAnimation) && (!isStartup) && (!root.taskInAnimation)
|
|
|
|
|
&&(!inBouncingAnimation) && !isSeparator
|
|
|
|
|
|
|
|
|
|
if (root.latteView && (!root.showPreviews && root.titleTooltips) || (root.showPreviews && root.titleTooltips && isLauncher)){
|
|
|
|
|
taskItem.showTitleTooltip();
|
|
|
|
|
}
|
|
|
|
|
property bool pressed: false
|
|
|
|
|
|
|
|
|
|
//! show previews if enabled
|
|
|
|
|
if(isAbleToShowPreview && !showPreviewsIsBlockedFromReleaseEvent && !isLauncher
|
|
|
|
|
&& (((root.showPreviews || (windowsPreviewDlg.visible && !isLauncher))
|
|
|
|
|
&& windowsPreviewDlg.activeItem !== taskItem)
|
|
|
|
|
|| root.highlightWindows)){
|
|
|
|
|
onEntered: {
|
|
|
|
|
if (isLauncher && windowsPreviewDlg.visible) {
|
|
|
|
|
windowsPreviewDlg.hide(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!root.disableAllWindowsFunctionality) {
|
|
|
|
|
//! don't delay showing preview in normal states,
|
|
|
|
|
//! that is when the dock wasn't hidden
|
|
|
|
|
if (!hoveredTimer.running && !windowsPreviewDlg.visible) {
|
|
|
|
|
//! first task with no previews shown can trigger the delay
|
|
|
|
|
hoveredTimer.start();
|
|
|
|
|
} else if (windowsPreviewDlg.visible) {
|
|
|
|
|
//! when the previews are already shown, update them immediately
|
|
|
|
|
taskItem.showPreviewWindow();
|
|
|
|
|
if (root.latteView && (!root.showPreviews && root.titleTooltips) || (root.showPreviews && root.titleTooltips && isLauncher)){
|
|
|
|
|
taskItem.showTitleTooltip();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//! show previews if enabled
|
|
|
|
|
if(isAbleToShowPreview && !showPreviewsIsBlockedFromReleaseEvent && !isLauncher
|
|
|
|
|
&& (((root.showPreviews || (windowsPreviewDlg.visible && !isLauncher))
|
|
|
|
|
&& windowsPreviewDlg.activeItem !== taskItem)
|
|
|
|
|
|| root.highlightWindows)){
|
|
|
|
|
|
|
|
|
|
if (!root.disableAllWindowsFunctionality) {
|
|
|
|
|
//! don't delay showing preview in normal states,
|
|
|
|
|
//! that is when the dock wasn't hidden
|
|
|
|
|
if (!hoveredTimer.running && !windowsPreviewDlg.visible) {
|
|
|
|
|
//! first task with no previews shown can trigger the delay
|
|
|
|
|
hoveredTimer.start();
|
|
|
|
|
} else if (windowsPreviewDlg.visible) {
|
|
|
|
|
//! when the previews are already shown, update them immediately
|
|
|
|
|
taskItem.showPreviewWindow();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
taskItem.showPreviewsIsBlockedFromReleaseEvent = false;
|
|
|
|
|
taskItem.showPreviewsIsBlockedFromReleaseEvent = false;
|
|
|
|
|
|
|
|
|
|
if (root.autoScrollTasksEnabled) {
|
|
|
|
|
scrollableList.autoScrollFor(taskItem, false);
|
|
|
|
|
if (root.autoScrollTasksEnabled) {
|
|
|
|
|
scrollableList.autoScrollFor(taskItem, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onExited: {
|
|
|
|
|
taskItem.isAbleToShowPreview = true;
|
|
|
|
|
onExited: {
|
|
|
|
|
taskItem.isAbleToShowPreview = true;
|
|
|
|
|
|
|
|
|
|
if (root.latteView && (!root.showPreviews || (root.showPreviews && isLauncher))){
|
|
|
|
|
root.latteView.hideTooltipLabel();
|
|
|
|
|
}
|
|
|
|
|
if (root.latteView && (!root.showPreviews || (root.showPreviews && isLauncher))){
|
|
|
|
|
root.latteView.hideTooltipLabel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (root.showPreviews) {
|
|
|
|
|
root.hidePreview(17.5);
|
|
|
|
|
if (root.showPreviews) {
|
|
|
|
|
root.hidePreview(17.5);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IMPORTANT: This must be improved ! even for small milliseconds it reduces performance
|
|
|
|
|
onPositionChanged: {
|
|
|
|
|
if ((inBlockingAnimation && !(inAttentionAnimation||inFastRestoreAnimation||inMimicParabolicAnimation)))
|
|
|
|
|
return;
|
|
|
|
|
// IMPORTANT: This must be improved ! even for small milliseconds it reduces performance
|
|
|
|
|
onPositionChanged: {
|
|
|
|
|
if ((inBlockingAnimation && !(inAttentionAnimation||inFastRestoreAnimation||inMimicParabolicAnimation)))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (root.latteView && root.latteView.isHalfShown) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (root.latteView && root.latteView.isHalfShown) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if((inAnimation == false)&&(!root.taskInAnimation)&&(!root.disableRestoreZoom) && hoverEnabled){
|
|
|
|
|
// mouse.button is always 0 here, hence checking with mouse.buttons
|
|
|
|
|
if (pressX != -1 && mouse.buttons == Qt.LeftButton
|
|
|
|
|
&& isDragged
|
|
|
|
|
&& dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y) ) {
|
|
|
|
|
root.dragSource = taskItem;
|
|
|
|
|
dragHelper.startDrag(taskItem, model.MimeType, model.MimeData,
|
|
|
|
|
model.LauncherUrlWithoutIcon, model.decoration);
|
|
|
|
|
pressX = -1;
|
|
|
|
|
pressY = -1;
|
|
|
|
|
if((inAnimation == false)&&(!root.taskInAnimation)&&(!root.disableRestoreZoom) && hoverEnabled){
|
|
|
|
|
// mouse.button is always 0 here, hence checking with mouse.buttons
|
|
|
|
|
if (pressX != -1 && mouse.buttons == Qt.LeftButton
|
|
|
|
|
&& isDragged
|
|
|
|
|
&& dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y) ) {
|
|
|
|
|
root.dragSource = taskItem;
|
|
|
|
|
dragHelper.startDrag(taskItem, model.MimeType, model.MimeData,
|
|
|
|
|
model.LauncherUrlWithoutIcon, model.decoration);
|
|
|
|
|
pressX = -1;
|
|
|
|
|
pressY = -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onContainsMouseChanged:{
|
|
|
|
|
if(!containsMouse && !inAnimation) {
|
|
|
|
|
pressed=false;
|
|
|
|
|
}
|
|
|
|
|
onContainsMouseChanged:{
|
|
|
|
|
if(!containsMouse && !inAnimation) {
|
|
|
|
|
pressed=false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////disable hover effect///
|
|
|
|
|
if (isWindow && root.highlightWindows && !containsMouse) {
|
|
|
|
|
root.windowsHovered( root.plasma515 ? model.WinIdList : model.LegacyWinIdList , false);
|
|
|
|
|
////disable hover effect///
|
|
|
|
|
if (isWindow && root.highlightWindows && !containsMouse) {
|
|
|
|
|
root.windowsHovered( root.plasma515 ? model.WinIdList : model.LegacyWinIdList , false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onPressed: {
|
|
|
|
|
//console.log("Pressed Task Delegate..");
|
|
|
|
|
if (LatteCore.WindowSystem.compositingActive && !LatteCore.WindowSystem.isPlatformWayland) {
|
|
|
|
|
if(root.leftClickAction !== LatteTasks.Types.PreviewWindows) {
|
|
|
|
|
isAbleToShowPreview = false;
|
|
|
|
|
windowsPreviewDlg.hide(2);
|
|
|
|
|
onPressed: {
|
|
|
|
|
//console.log("Pressed Task Delegate..");
|
|
|
|
|
if (LatteCore.WindowSystem.compositingActive && !LatteCore.WindowSystem.isPlatformWayland) {
|
|
|
|
|
if(root.leftClickAction !== LatteTasks.Types.PreviewWindows) {
|
|
|
|
|
isAbleToShowPreview = false;
|
|
|
|
|
windowsPreviewDlg.hide(2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slotPublishGeometries();
|
|
|
|
|
slotPublishGeometries();
|
|
|
|
|
|
|
|
|
|
var modAccepted = modifierAccepted(mouse);
|
|
|
|
|
var modAccepted = modifierAccepted(mouse);
|
|
|
|
|
|
|
|
|
|
if ((mouse.button == Qt.LeftButton)||(mouse.button == Qt.MidButton) || modAccepted) {
|
|
|
|
|
lastButtonClicked = mouse.button;
|
|
|
|
|
pressed = true;
|
|
|
|
|
pressX = mouse.x;
|
|
|
|
|
pressY = mouse.y;
|
|
|
|
|
if ((mouse.button == Qt.LeftButton)||(mouse.button == Qt.MidButton) || modAccepted) {
|
|
|
|
|
lastButtonClicked = mouse.button;
|
|
|
|
|
pressed = true;
|
|
|
|
|
pressX = mouse.x;
|
|
|
|
|
pressY = mouse.y;
|
|
|
|
|
|
|
|
|
|
if(!modAccepted){
|
|
|
|
|
resistanerTimer.start();
|
|
|
|
|
if(!modAccepted){
|
|
|
|
|
resistanerTimer.start();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (mouse.button == Qt.RightButton && !modAccepted){
|
|
|
|
|
// When we're a launcher, there's no window controls, so we can show all
|
|
|
|
|
// places without the menu getting super huge.
|
|
|
|
|
if (model.IsLauncher === true && !isSeparator) {
|
|
|
|
|
showContextMenu({showAllPlaces: true})
|
|
|
|
|
} else {
|
|
|
|
|
showContextMenu();
|
|
|
|
|
else if (mouse.button == Qt.RightButton && !modAccepted){
|
|
|
|
|
// When we're a launcher, there's no window controls, so we can show all
|
|
|
|
|
// places without the menu getting super huge.
|
|
|
|
|
if (model.IsLauncher === true && !isSeparator) {
|
|
|
|
|
showContextMenu({showAllPlaces: true})
|
|
|
|
|
} else {
|
|
|
|
|
showContextMenu();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onReleased: {
|
|
|
|
|
//console.log("Released Task Delegate...");
|
|
|
|
|
resistanerTimer.stop();
|
|
|
|
|
|
|
|
|
|
if(pressed && (!inBlockingAnimation || inAttentionAnimation) && !isSeparator){
|
|
|
|
|
|
|
|
|
|
if (modifierAccepted(mouse) && !root.disableAllWindowsFunctionality){
|
|
|
|
|
if( !taskItem.isLauncher ){
|
|
|
|
|
if (root.modifierClickAction == LatteTasks.Types.NewInstance) {
|
|
|
|
|
tasksModel.requestNewInstance(modelIndex());
|
|
|
|
|
} else if (root.modifierClickAction == LatteTasks.Types.Close) {
|
|
|
|
|
tasksModel.requestClose(modelIndex());
|
|
|
|
|
} else if (root.modifierClickAction == LatteTasks.Types.ToggleMinimized) {
|
|
|
|
|
tasksModel.requestToggleMinimized(modelIndex());
|
|
|
|
|
} else if ( root.modifierClickAction == LatteTasks.Types.CycleThroughTasks) {
|
|
|
|
|
if (isGroupParent)
|
|
|
|
|
subWindows.activateNextTask();
|
|
|
|
|
else
|
|
|
|
|
activateTask();
|
|
|
|
|
} else if (root.modifierClickAction == LatteTasks.Types.ToggleGrouping) {
|
|
|
|
|
tasksModel.requestToggleGrouping(modelIndex());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
activateTask();
|
|
|
|
|
}
|
|
|
|
|
} else if (mouse.button == Qt.MidButton && !root.disableAllWindowsFunctionality){
|
|
|
|
|
if( !taskItem.isLauncher ){
|
|
|
|
|
if (root.middleClickAction == LatteTasks.Types.NewInstance) {
|
|
|
|
|
tasksModel.requestNewInstance(modelIndex());
|
|
|
|
|
} else if (root.middleClickAction == LatteTasks.Types.Close) {
|
|
|
|
|
tasksModel.requestClose(modelIndex());
|
|
|
|
|
} else if (root.middleClickAction == LatteTasks.Types.ToggleMinimized) {
|
|
|
|
|
tasksModel.requestToggleMinimized(modelIndex());
|
|
|
|
|
} else if ( root.middleClickAction == LatteTasks.Types.CycleThroughTasks) {
|
|
|
|
|
if (isGroupParent)
|
|
|
|
|
subWindows.activateNextTask();
|
|
|
|
|
else
|
|
|
|
|
activateTask();
|
|
|
|
|
} else if (root.middleClickAction == LatteTasks.Types.ToggleGrouping) {
|
|
|
|
|
tasksModel.requestToggleGrouping(modelIndex());
|
|
|
|
|
onReleased: {
|
|
|
|
|
//console.log("Released Task Delegate...");
|
|
|
|
|
resistanerTimer.stop();
|
|
|
|
|
|
|
|
|
|
if(pressed && (!inBlockingAnimation || inAttentionAnimation) && !isSeparator){
|
|
|
|
|
|
|
|
|
|
if (modifierAccepted(mouse) && !root.disableAllWindowsFunctionality){
|
|
|
|
|
if( !taskItem.isLauncher ){
|
|
|
|
|
if (root.modifierClickAction == LatteTasks.Types.NewInstance) {
|
|
|
|
|
tasksModel.requestNewInstance(modelIndex());
|
|
|
|
|
} else if (root.modifierClickAction == LatteTasks.Types.Close) {
|
|
|
|
|
tasksModel.requestClose(modelIndex());
|
|
|
|
|
} else if (root.modifierClickAction == LatteTasks.Types.ToggleMinimized) {
|
|
|
|
|
tasksModel.requestToggleMinimized(modelIndex());
|
|
|
|
|
} else if ( root.modifierClickAction == LatteTasks.Types.CycleThroughTasks) {
|
|
|
|
|
if (isGroupParent)
|
|
|
|
|
subWindows.activateNextTask();
|
|
|
|
|
else
|
|
|
|
|
activateTask();
|
|
|
|
|
} else if (root.modifierClickAction == LatteTasks.Types.ToggleGrouping) {
|
|
|
|
|
tasksModel.requestToggleGrouping(modelIndex());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
activateTask();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
activateTask();
|
|
|
|
|
}
|
|
|
|
|
} else if (mouse.button == Qt.LeftButton){
|
|
|
|
|
if( !taskItem.isLauncher && !root.disableAllWindowsFunctionality ){
|
|
|
|
|
if ( (root.leftClickAction === LatteTasks.Types.PreviewWindows && isGroupParent)
|
|
|
|
|
|| ( (LatteCore.WindowSystem.isPlatformWayland || !LatteCore.WindowSystem.compositingActive)
|
|
|
|
|
&& root.leftClickAction === LatteTasks.Types.PresentWindows
|
|
|
|
|
&& isGroupParent) ) {
|
|
|
|
|
if(windowsPreviewDlg.activeItem !== taskItem || !windowsPreviewDlg.visible){
|
|
|
|
|
showPreviewWindow();
|
|
|
|
|
} else {
|
|
|
|
|
forceHidePreview(21.1);
|
|
|
|
|
} else if (mouse.button == Qt.MidButton && !root.disableAllWindowsFunctionality){
|
|
|
|
|
if( !taskItem.isLauncher ){
|
|
|
|
|
if (root.middleClickAction == LatteTasks.Types.NewInstance) {
|
|
|
|
|
tasksModel.requestNewInstance(modelIndex());
|
|
|
|
|
} else if (root.middleClickAction == LatteTasks.Types.Close) {
|
|
|
|
|
tasksModel.requestClose(modelIndex());
|
|
|
|
|
} else if (root.middleClickAction == LatteTasks.Types.ToggleMinimized) {
|
|
|
|
|
tasksModel.requestToggleMinimized(modelIndex());
|
|
|
|
|
} else if ( root.middleClickAction == LatteTasks.Types.CycleThroughTasks) {
|
|
|
|
|
if (isGroupParent)
|
|
|
|
|
subWindows.activateNextTask();
|
|
|
|
|
else
|
|
|
|
|
activateTask();
|
|
|
|
|
} else if (root.middleClickAction == LatteTasks.Types.ToggleGrouping) {
|
|
|
|
|
tasksModel.requestToggleGrouping(modelIndex());
|
|
|
|
|
}
|
|
|
|
|
} else if ( (root.leftClickAction === LatteTasks.Types.PresentWindows && !(isGroupParent && !LatteCore.WindowSystem.compositingActive))
|
|
|
|
|
|| ((root.leftClickAction === LatteTasks.Types.PreviewWindows && !isGroupParent)) ) {
|
|
|
|
|
} else {
|
|
|
|
|
activateTask();
|
|
|
|
|
} else if (root.leftClickAction === LatteTasks.Types.CycleThroughTasks) {
|
|
|
|
|
if (isGroupParent)
|
|
|
|
|
subWindows.activateNextTask();
|
|
|
|
|
else
|
|
|
|
|
}
|
|
|
|
|
} else if (mouse.button == Qt.LeftButton){
|
|
|
|
|
if( !taskItem.isLauncher && !root.disableAllWindowsFunctionality ){
|
|
|
|
|
if ( (root.leftClickAction === LatteTasks.Types.PreviewWindows && isGroupParent)
|
|
|
|
|
|| ( (LatteCore.WindowSystem.isPlatformWayland || !LatteCore.WindowSystem.compositingActive)
|
|
|
|
|
&& root.leftClickAction === LatteTasks.Types.PresentWindows
|
|
|
|
|
&& isGroupParent) ) {
|
|
|
|
|
if(windowsPreviewDlg.activeItem !== taskItem || !windowsPreviewDlg.visible){
|
|
|
|
|
showPreviewWindow();
|
|
|
|
|
} else {
|
|
|
|
|
forceHidePreview(21.1);
|
|
|
|
|
}
|
|
|
|
|
} else if ( (root.leftClickAction === LatteTasks.Types.PresentWindows && !(isGroupParent && !LatteCore.WindowSystem.compositingActive))
|
|
|
|
|
|| ((root.leftClickAction === LatteTasks.Types.PreviewWindows && !isGroupParent)) ) {
|
|
|
|
|
activateTask();
|
|
|
|
|
} else if (root.leftClickAction === LatteTasks.Types.CycleThroughTasks) {
|
|
|
|
|
if (isGroupParent)
|
|
|
|
|
subWindows.activateNextTask();
|
|
|
|
|
else
|
|
|
|
|
activateTask();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
activateTask();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
activateTask();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
backend.cancelHighlightWindows();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
backend.cancelHighlightWindows();
|
|
|
|
|
pressed = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pressed = false;
|
|
|
|
|
}
|
|
|
|
|
onWheel: {
|
|
|
|
|
var wheelActionsEnabled = (root.taskScrollAction !== LatteTasks.Types.ScrollNone || manualScrollTasksEnabled);
|
|
|
|
|
|
|
|
|
|
onWheel: {
|
|
|
|
|
var wheelActionsEnabled = (root.taskScrollAction !== LatteTasks.Types.ScrollNone || manualScrollTasksEnabled);
|
|
|
|
|
if (isSeparator
|
|
|
|
|
|| wheelIsBlocked
|
|
|
|
|
|| !wheelActionsEnabled
|
|
|
|
|
|| inBouncingAnimation
|
|
|
|
|
|| (latteView && (latteView.dockIsHidden || latteView.inSlidingIn || latteView.inSlidingOut))){
|
|
|
|
|
|
|
|
|
|
if (isSeparator
|
|
|
|
|
|| wheelIsBlocked
|
|
|
|
|
|| !wheelActionsEnabled
|
|
|
|
|
|| inBouncingAnimation
|
|
|
|
|
|| (latteView && (latteView.dockIsHidden || latteView.inSlidingIn || latteView.inSlidingOut))){
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var angleVertical = wheel.angleDelta.y / 8;
|
|
|
|
|
var angleHorizontal = wheel.angleDelta.x / 8;
|
|
|
|
|
var angleVertical = wheel.angleDelta.y / 8;
|
|
|
|
|
var angleHorizontal = wheel.angleDelta.x / 8;
|
|
|
|
|
|
|
|
|
|
wheelIsBlocked = true;
|
|
|
|
|
scrollDelayer.start();
|
|
|
|
|
wheelIsBlocked = true;
|
|
|
|
|
scrollDelayer.start();
|
|
|
|
|
|
|
|
|
|
var verticalDirection = (Math.abs(angleVertical) > Math.abs(angleHorizontal));
|
|
|
|
|
var mainAngle = verticalDirection ? angleVertical : angleHorizontal;
|
|
|
|
|
var verticalDirection = (Math.abs(angleVertical) > Math.abs(angleHorizontal));
|
|
|
|
|
var mainAngle = verticalDirection ? angleVertical : angleHorizontal;
|
|
|
|
|
|
|
|
|
|
var positiveDirection = (mainAngle > 12);
|
|
|
|
|
var negativeDirection = (mainAngle < -12);
|
|
|
|
|
var positiveDirection = (mainAngle > 12);
|
|
|
|
|
var negativeDirection = (mainAngle < -12);
|
|
|
|
|
|
|
|
|
|
var parallelScrolling = (verticalDirection && plasmoid.formFactor === PlasmaCore.Types.Vertical)
|
|
|
|
|
|| (!verticalDirection && plasmoid.formFactor === PlasmaCore.Types.Horizontal);
|
|
|
|
|
var parallelScrolling = (verticalDirection && plasmoid.formFactor === PlasmaCore.Types.Vertical)
|
|
|
|
|
|| (!verticalDirection && plasmoid.formFactor === PlasmaCore.Types.Horizontal);
|
|
|
|
|
|
|
|
|
|
if (positiveDirection) {
|
|
|
|
|
slotPublishGeometries();
|
|
|
|
|
if (positiveDirection) {
|
|
|
|
|
slotPublishGeometries();
|
|
|
|
|
|
|
|
|
|
var overflowScrollingAccepted = (root.manualScrollTasksEnabled
|
|
|
|
|
&& scrollableList.contentsExceed
|
|
|
|
|
&& (root.manualScrollTasksType === LatteTasks.Types.ManualScrollVerticalHorizontal
|
|
|
|
|
|| (root.manualScrollTasksType === LatteTasks.Types.ManualScrollOnlyParallel && parallelScrolling)) );
|
|
|
|
|
var overflowScrollingAccepted = (root.manualScrollTasksEnabled
|
|
|
|
|
&& scrollableList.contentsExceed
|
|
|
|
|
&& (root.manualScrollTasksType === LatteTasks.Types.ManualScrollVerticalHorizontal
|
|
|
|
|
|| (root.manualScrollTasksType === LatteTasks.Types.ManualScrollOnlyParallel && parallelScrolling)) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (overflowScrollingAccepted) {
|
|
|
|
|
scrollableList.decreasePos();
|
|
|
|
|
} else {
|
|
|
|
|
if (isLauncher || root.disableAllWindowsFunctionality) {
|
|
|
|
|
wrapper.runLauncherAnimation();
|
|
|
|
|
} else if (isGroupParent) {
|
|
|
|
|
subWindows.activateNextTask();
|
|
|
|
|
if (overflowScrollingAccepted) {
|
|
|
|
|
scrollableList.decreasePos();
|
|
|
|
|
} else {
|
|
|
|
|
var taskIndex = modelIndex();
|
|
|
|
|
if (isLauncher || root.disableAllWindowsFunctionality) {
|
|
|
|
|
wrapper.runLauncherAnimation();
|
|
|
|
|
} else if (isGroupParent) {
|
|
|
|
|
subWindows.activateNextTask();
|
|
|
|
|
} else {
|
|
|
|
|
var taskIndex = modelIndex();
|
|
|
|
|
|
|
|
|
|
if (isMinimized) {
|
|
|
|
|
tasksModel.requestToggleMinimized(taskIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isMinimized) {
|
|
|
|
|
tasksModel.requestToggleMinimized(taskIndex);
|
|
|
|
|
tasksModel.requestActivate(taskIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tasksModel.requestActivate(taskIndex);
|
|
|
|
|
// hidePreviewWindow();
|
|
|
|
|
}
|
|
|
|
|
} else if (negativeDirection) {
|
|
|
|
|
slotPublishGeometries();
|
|
|
|
|
|
|
|
|
|
// hidePreviewWindow();
|
|
|
|
|
}
|
|
|
|
|
} else if (negativeDirection) {
|
|
|
|
|
slotPublishGeometries();
|
|
|
|
|
|
|
|
|
|
var overflowScrollingAccepted = (root.manualScrollTasksEnabled
|
|
|
|
|
&& scrollableList.contentsExceed
|
|
|
|
|
&& (root.manualScrollTasksType === LatteTasks.Types.ManualScrollVerticalHorizontal
|
|
|
|
|
|| (root.manualScrollTasksType === LatteTasks.Types.ManualScrollOnlyParallel && parallelScrolling)) );
|
|
|
|
|
var overflowScrollingAccepted = (root.manualScrollTasksEnabled
|
|
|
|
|
&& scrollableList.contentsExceed
|
|
|
|
|
&& (root.manualScrollTasksType === LatteTasks.Types.ManualScrollVerticalHorizontal
|
|
|
|
|
|| (root.manualScrollTasksType === LatteTasks.Types.ManualScrollOnlyParallel && parallelScrolling)) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (overflowScrollingAccepted) {
|
|
|
|
|
scrollableList.increasePos();
|
|
|
|
|
} else {
|
|
|
|
|
if (isLauncher || root.disableAllWindowsFunctionality) {
|
|
|
|
|
// do nothing
|
|
|
|
|
} else if (isGroupParent) {
|
|
|
|
|
if (root.taskScrollAction === LatteTasks.Types.ScrollToggleMinimized) {
|
|
|
|
|
subWindows.minimizeTask();
|
|
|
|
|
} else {
|
|
|
|
|
subWindows.activatePreviousTask();
|
|
|
|
|
}
|
|
|
|
|
if (overflowScrollingAccepted) {
|
|
|
|
|
scrollableList.increasePos();
|
|
|
|
|
} else {
|
|
|
|
|
var taskIndex = modelIndex();
|
|
|
|
|
if (isLauncher || root.disableAllWindowsFunctionality) {
|
|
|
|
|
// do nothing
|
|
|
|
|
} else if (isGroupParent) {
|
|
|
|
|
if (root.taskScrollAction === LatteTasks.Types.ScrollToggleMinimized) {
|
|
|
|
|
subWindows.minimizeTask();
|
|
|
|
|
} else {
|
|
|
|
|
subWindows.activatePreviousTask();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
var taskIndex = modelIndex();
|
|
|
|
|
|
|
|
|
|
var hidingTask = (!isMinimized && root.taskScrollAction === LatteTasks.Types.ScrollToggleMinimized);
|
|
|
|
|
var hidingTask = (!isMinimized && root.taskScrollAction === LatteTasks.Types.ScrollToggleMinimized);
|
|
|
|
|
|
|
|
|
|
if (isMinimized || hidingTask) {
|
|
|
|
|
tasksModel.requestToggleMinimized(taskIndex);
|
|
|
|
|
}
|
|
|
|
|
if (isMinimized || hidingTask) {
|
|
|
|
|
tasksModel.requestToggleMinimized(taskIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!hidingTask) {
|
|
|
|
|
tasksModel.requestActivate(taskIndex);
|
|
|
|
|
if (!hidingTask) {
|
|
|
|
|
tasksModel.requestActivate(taskIndex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// hidePreviewWindow();
|
|
|
|
|
// hidePreviewWindow();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//! A timer is needed in order to handle also touchpads that probably
|
|
|
|
|