updates for hidden tasks and int.separators

pull/2/head
Michail Vourlakos 7 years ago
parent b8c07b8523
commit eec2927f88

@ -49,7 +49,7 @@ Item {
var internSepStep = 0;
if(appIndex<root.latteAppletPos){
if (root.latteApplet.parabolicManager.taskIsSeparator(0)
|| (!root.showWindowsWithNoLaunchers && root.latteApplet.parabolicManager.taskIsHiddenBecauseNoLauncherExists(0)) )
|| (!root.showWindowsWithNoLaunchers && root.latteApplet.parabolicManager.taskIsForcedHidden(0)) )
internSepStep = root.latteApplet.parabolicManager.availableHigherIndex(0);
taskIndex = signalStep-appStep+internSepStep;
@ -59,7 +59,7 @@ Item {
//console.log("normal:" + taskIndex + " step:"+internSepStep + " zoom:"+zScale);
} else if (appIndex>root.latteAppletPos){
if (root.latteApplet.parabolicManager.taskIsSeparator(root.tasksCount-1)
|| (!root.showWindowsWithNoLaunchers && root.latteApplet.parabolicManager.taskIsHiddenBecauseNoLauncherExists(root.tasksCount-1)) )
|| (!root.showWindowsWithNoLaunchers && root.latteApplet.parabolicManager.taskIsForcedHidden(root.tasksCount-1)) )
internSepStep = Math.abs(root.tasksCount-1 - root.latteApplet.parabolicManager.availableLowerIndex(root.tasksCount-1));
taskIndex = root.tasksCount-1 - (signalStep-appStep) - internSepStep;

@ -107,7 +107,9 @@ Item {
}
}
Component.onCompleted: updateTasksEdgesIndexes();
Component.onCompleted: {
updateTasksEdgesIndexes();
}
function updateTasksEdgesIndexes() {
var newFirstTask = firstRealTask();
@ -369,7 +371,7 @@ Item {
var next = from;
while (next>=0
&& (taskIsSeparator(next) || (root.showWindowsOnlyFromLaunchers && taskIsHiddenBecauseNoLauncherExists(next))) )
&& (taskIsSeparator(next) || (root.showWindowsOnlyFromLaunchers && taskIsForcedHidden(next))) )
next = next - 1;
return next;
@ -379,7 +381,7 @@ Item {
var next = from;
while (next<=root.tasksCount-1
&& (taskIsSeparator(next) || (root.showWindowsOnlyFromLaunchers && taskIsHiddenBecauseNoLauncherExists(next))) ) {
&& (taskIsSeparator(next) || (root.showWindowsOnlyFromLaunchers && taskIsForcedHidden(next))) ) {
next = next + 1;
}
@ -405,20 +407,12 @@ Item {
return false;
}
function taskIsHiddenBecauseNoLauncherExists(taskIndex) {
function taskIsForcedHidden(taskIndex) {
var task = icList.childAtIndex(taskIndex);
if (task && root.showWindowsOnlyFromLaunchers) {
var launcherExists = !(((tasksModel.launcherPosition(task.launcherUrl) == -1)
&& (tasksModel.launcherPosition(task.launcherUrlWithIcon) == -1) )
|| !task.launcherIsPresent(task.launcherUrl));
//console.log(task.launcherUrl + " ::: " +!launcherExists + " _ " + task.isWindow);
return (!launcherExists && task.isWindow);
}
return false;
//!tasks that become hidden there is a chance to have index===-1 and to not be
//!able to be tracked down
return ((!task && (taskIndex>=0 && taskIndex<root.tasksCount)) || task.isForcedHidden);
}
function separatorExists(separator){
@ -469,7 +463,7 @@ Item {
var i=0;
while (i<=root.tasksCount-1) {
if (!taskIsSeparator(i)) {
if (!taskIsSeparator(i) && !taskIsForcedHidden(i)) {
return i;
}
@ -486,7 +480,7 @@ Item {
var i = tasksModel.count - 1;
while (i>=0) {
if (!taskIsSeparator(i) && !taskIsHiddenBecauseNoLauncherExists(i) ) {
if (!taskIsSeparator(i) && !taskIsForcedHidden(i) ) {
return i;
}

@ -247,6 +247,7 @@ Item {
signal clearZoomSignal();
signal draggingFinished();
signal hiddenTasksUpdated();
signal launchersUpdatedFor(string launcher);
signal presentWindows(variant winIds);
signal requestLayout;

@ -61,6 +61,10 @@ MouseArea{
}
}
/*onWidthChanged: {
console.log("T: " + itemIndex + " - " + launcherUrl + " - " + width + " _ "+ hiddenSpacerLeft.width + " _ " + wrapper.width + " _ " + hiddenSpacerRight.width);
}*/
height: {
if (!visible)
return 0;
@ -107,6 +111,7 @@ MouseArea{
property bool isDemandingAttention: (IsDemandingAttention === true) ? true : false
property bool isDragged: false
property bool isGroupParent: (IsGroupParent === true) ? true : false
property bool isForcedHidden: false
property bool isLauncher: (IsLauncher === true) ? true : false
property bool isMinimized: (IsMinimized === true) ? true : false
property bool isSeparator: false
@ -308,14 +313,21 @@ MouseArea{
forceHiddenState = false;
} else {
var firstPosition = (index>=0) && (index < parabolicManager.firstRealTaskIndex);
var sepNeighbour = parabolicManager.taskIsSeparator(index-1);
var sepNeighbour = mainItemContainer.hasNeighbourSeparator(index-1, false);
var firstSepFromLastSeparatorsGroup = (index>=0) && (index > parabolicManager.lastRealTaskIndex);
forceHiddenState = (firstPosition || sepNeighbour || firstSepFromLastSeparatorsGroup);
}
}
Component.onCompleted: updateForceHiddenState();
Component.onCompleted: {
updateForceHiddenState();
root.hiddenTasksUpdated.connect(updateForceHiddenState);
}
Component.onDestruction: {
root.hiddenTasksUpdated.disconnect(updateForceHiddenState);
}
onForceHiddenStateChanged: root.separatorsUpdated();
@ -500,6 +512,8 @@ MouseArea{
checkWindowsStates();
}
onIsForcedHiddenChanged: root.hiddenTasksUpdated();
onIsSeparatorChanged: {
if (isSeparator) {
parabolicManager.setSeparator(launcherUrl, itemIndex);
@ -927,6 +941,17 @@ MouseArea{
}
}
function hasNeighbourSeparator(ind, positive) {
var cursor = ind;
while (((!positive && cursor>=0) || (positive && cursor<=root.tasksCount-1))
&& parabolicManager.taskIsForcedHidden(cursor) ) {
cursor = positive ? cursor + 1 : cursor - 1;
}
return parabolicManager.taskIsSeparator(cursor);
}
function preparePreviewWindow(hideClose){
windowsPreviewDlg.visualParent = previewsVisualParent;
@ -1236,15 +1261,18 @@ MouseArea{
var hideWindow = !launcherExists && mainItemContainer.isWindow;
if (hideWindow) {
isForcedHidden = true;
taskRealRemovalAnimation.start();
} else if (launcherExists && mainItemContainer.isWindow && !mainItemContainer.isVisible) {
showWindowAnimation.showWindow();
isForcedHidden = false;
}
} else {
var showWindow = !launcherExists && mainItemContainer.isWindow;
if (showWindow) {
showWindowAnimation.showWindow();
isForcedHidden = false;
}
}
}

@ -52,7 +52,9 @@ Item{
property bool rightSpacer: false
property real nHiddenSize: {
if (!inAttentionAnimation && !inMimicParabolicAnimation && !inFastRestoreAnimation) {
if (isForcedHidden) {
return 0;
} else if (!inAttentionAnimation && !inMimicParabolicAnimation && !inFastRestoreAnimation) {
return (nScale > 0) ? (mainItemContainer.spacersMaxSize * nScale) + separatorSpace : separatorSpace;
} else {
return (nScale > 0) ? (root.iconSize * nScale) + separatorSpace : separatorSpace;
@ -67,10 +69,10 @@ Item{
neighbourSeparator = false;
} else if (latteDock && index!==-1) {
if (!rightSpacer) {
neighbourSeparator = (parabolicManager.taskIsSeparator(itemIndex-1) && !isSeparator && itemIndex!==parabolicManager.firstRealTaskIndex)
neighbourSeparator = (mainItemContainer.hasNeighbourSeparator(itemIndex-1, false) && !isSeparator && itemIndex!==parabolicManager.firstRealTaskIndex)
|| (latteDock.parabolicManager.isSeparator(latteDock.latteAppletPos-1) && parabolicManager.firstRealTaskIndex === itemIndex);
} else {
neighbourSeparator = (parabolicManager.taskIsSeparator(itemIndex+1) && !isSeparator && itemIndex!==parabolicManager.lastRealTaskIndex)
neighbourSeparator = (mainItemContainer.hasNeighbourSeparator(itemIndex+1,true) && !isSeparator && itemIndex!==parabolicManager.lastRealTaskIndex)
|| (latteDock.parabolicManager.isSeparator(latteDock.latteAppletPos+1) && parabolicManager.lastRealTaskIndex === itemIndex );
}
@ -103,7 +105,14 @@ Item{
onItemIndexChanged: hiddenSpacer.updateNeighbour();
}
Component.onCompleted: hiddenSpacer.updateNeighbour();
Component.onCompleted: {
root.hiddenTasksUpdated.connect(updateNeighbour);
hiddenSpacer.updateNeighbour();
}
Component.onDestruction: {
root.hiddenTasksUpdated.disconnect(updateNeighbour);
}
Behavior on nHiddenSize {
id: animatedBehavior

@ -143,6 +143,7 @@ SequentialAnimation{
}
if (hideStartup || hideWindow) {
isForcedHidden = true;
mainItemContainer.visible = false;
wrapper.tempScaleWidth = 0;
wrapper.tempScaleHeight = 0;
@ -156,7 +157,7 @@ SequentialAnimation{
wrapper.mScale = 1;
wrapper.opacity = 1;
mainItemContainer.inAnimation = false;
} else if (( animation2 || animation3 || animation6) && (root.durationTime !== 0)){
} else if (( animation2 || animation3 || animation6 || isForcedHidden) && (root.durationTime !== 0)){
mainItemContainer.visible = true;
wrapper.tempScaleWidth = 0;
wrapper.tempScaleHeight = 0;

Loading…
Cancel
Save