fix #431,support internal tasks separator

pull/1/head
Michail Vourlakos 8 years ago
parent 6bb14547e5
commit f24da87b19

@ -120,6 +120,8 @@ MouseArea{
if (modelLauncherUrl.indexOf("latte-separator.desktop")>=0) if (modelLauncherUrl.indexOf("latte-separator.desktop")>=0)
isSeparator = true; isSeparator = true;
else
isSeparator = false;
} }
onModelLauncherUrlWithIconChanged: { onModelLauncherUrlWithIconChanged: {
@ -270,7 +272,7 @@ MouseArea{
if (!root.vertical) if (!root.vertical)
return 5 + widthMargins; return 5 + widthMargins;
else else
return root.iconSize + widthMargins; return (root.iconSize + widthMargins) * mScale + root.statesLineSize;
} }
if (mainItemContainer.isStartup && root.durationTime !==0 ) if (mainItemContainer.isStartup && root.durationTime !==0 )
@ -287,7 +289,7 @@ MouseArea{
if (root.vertical) if (root.vertical)
return 5 + heightMargins; return 5 + heightMargins;
else else
return root.iconSize + heightMargins; return (root.iconSize + heightMargins) * mScale + root.statesLineSize;
} }
if (mainItemContainer.isStartup && root.durationTime !==0) if (mainItemContainer.isStartup && root.durationTime !==0)
@ -325,8 +327,29 @@ MouseArea{
property real basicScalingWidth : (inTempScaling == true) ? ((root.iconSize + widthMargins) * scaleWidth) : cleanScalingWidth property real basicScalingWidth : (inTempScaling == true) ? ((root.iconSize + widthMargins) * scaleWidth) : cleanScalingWidth
property real basicScalingHeight : (inTempScaling == true) ? ((root.iconSize + heightMargins) * scaleHeight) : cleanScalingHeight property real basicScalingHeight : (inTempScaling == true) ? ((root.iconSize + heightMargins) * scaleHeight) : cleanScalingHeight
property real regulatorWidth: basicScalingWidth;//-2; property real regulatorWidth: mainItemContainer.isSeparator ? separatorRegWidth : basicScalingWidth;
property real regulatorHeight: basicScalingHeight;//-2; property real regulatorHeight: mainItemContainer.isSeparator ? separatorRegHeight : basicScalingHeight;
property real separatorRegWidth: {
if (!mainItemContainer.isSeparator)
return;
if (!root.vertical)
return 5 + widthMargins;
else
return (root.iconSize + root.thickMargin) * mScale;
}
property real separatorRegHeight: {
if (!mainItemContainer.isSeparator)
return;
if (root.vertical)
return 5 + widthMargins;
else
return (root.iconSize + root.thickMargin) * mScale;
}
/// end of Scalers/////// /// end of Scalers///////
//property int curIndex: icList.hoveredIndex //property int curIndex: icList.hoveredIndex
@ -395,7 +418,10 @@ MouseArea{
}//Flow }//Flow
function calculateScales( currentMousePosition ){ function calculateScales( currentMousePosition ){
if (root.editMode || mainItemContainer.isSeparator) { if (root.editMode) {
return;
} else if (mainItemContainer.isSeparator) {
wrapper.mScale = root.zoomFactor;
return; return;
} }
@ -445,8 +471,8 @@ MouseArea{
//activate messages to update the the neighbour scales //activate messages to update the the neighbour scales
root.updateScale(index+1, rightScale, 0); root.updateScale(index+1, rightScale, 0);
root.updateScale(index-1, leftScale, 0); root.updateScale(index-1, leftScale, 0);
root.updateScale(index+2, 1, 0); // root.updateScale(index+2, 1, 0);
root.updateScale(index-2, 1, 0); // root.updateScale(index-2, 1, 0);
//Left hiddenSpacer //Left hiddenSpacer
if(((index === 0 )&&(icList.count > 1)) && !root.disableLeftSpacer){ if(((index === 0 )&&(icList.count > 1)) && !root.disableLeftSpacer){
@ -466,8 +492,7 @@ MouseArea{
function signalUpdateScale(nIndex, nScale, step){ function signalUpdateScale(nIndex, nScale, step){
//if ((index === nIndex)&&(!mainItemContainer.inAnimation)){ //if ((index === nIndex)&&(!mainItemContainer.inAnimation)){
if ((index === nIndex)&&(mainItemContainer.hoverEnabled)&&(waitingLaunchers.length===0) if ((index === nIndex)&&(mainItemContainer.hoverEnabled)&&(waitingLaunchers.length===0)){
&&(!mainItemContainer.isSeparator)){
if(nScale >= 0) { if(nScale >= 0) {
mScale = nScale + step; mScale = nScale + step;
} else { } else {
@ -475,6 +500,13 @@ MouseArea{
} }
// console.log(index+ ", "+mScale); // console.log(index+ ", "+mScale);
} }
if ((index === nIndex) && mainItemContainer.isSeparator){
if (icList.hoveredIndex<index)
root.updateScale(index+1, nScale, step);
else if (icList.hoveredIndex>index)
root.updateScale(index-1, nScale, step);
}
} }
function sendEndOfNeedBothAxisAnimation(){ function sendEndOfNeedBothAxisAnimation(){
@ -716,10 +748,6 @@ MouseArea{
if(!inAnimation) if(!inAnimation)
pressed=false; pressed=false;
} else {
if (isSeparator){
icList.directRender = false;
}
} }
////window previews///////// ////window previews/////////
@ -1021,6 +1049,9 @@ MouseArea{
} }
function showContextMenu(args) { function showContextMenu(args) {
if (isSeparator)
return;
contextMenu = root.createContextMenu(mainItemContainer, modelIndex(), args); contextMenu = root.createContextMenu(mainItemContainer, modelIndex(), args);
contextMenu.show(); contextMenu.show();
} }

@ -40,7 +40,7 @@ Item{
property color minimizedColor: root.threeColorsWindows ? root.minimizedDotColor : isActiveColor property color minimizedColor: root.threeColorsWindows ? root.minimizedDotColor : isActiveColor
property color notActiveColor: mainItemContainer.hasMinimized ? minimizedColor : isActiveColor property color notActiveColor: mainItemContainer.hasMinimized ? minimizedColor : isActiveColor
/* Rectangle{ /*Rectangle{
anchors.fill: parent anchors.fill: parent
border.width: 1 border.width: 1
border.color: "yellow" border.color: "yellow"

@ -37,8 +37,8 @@ import org.kde.latte 0.1 as Latte
Item{ Item{
id: centralItem id: centralItem
width: mainItemContainer.isSeparator ? wrapper.width : wrapper.regulatorWidth width: wrapper.regulatorWidth
height: mainItemContainer.isSeparator ? wrapper.height : wrapper.regulatorHeight height: wrapper.regulatorHeight
//big interval to show shadows only after all the crappy adds and removes of tasks //big interval to show shadows only after all the crappy adds and removes of tasks
//have happened //have happened
@ -63,12 +63,12 @@ Item{
property QtObject buffers: null property QtObject buffers: null
property QtObject smartLauncherItem: null property QtObject smartLauncherItem: null
Rectangle{ /*Rectangle{
anchors.fill: parent anchors.fill: parent
border.width: 1 border.width: 1
border.color: "green" border.color: "green"
color: "transparent" color: "transparent"
} }*/
onSmartLauncherEnabledChanged: { onSmartLauncherEnabledChanged: {
if (smartLauncherEnabled && !smartLauncherItem) { if (smartLauncherEnabled && !smartLauncherItem) {
@ -87,8 +87,8 @@ Item{
Rectangle{ Rectangle{
id: draggedRectangle id: draggedRectangle
width: iconImageBuffer.width+1 width: mainItemContainer.isSeparator ? parent.width + 1 : iconImageBuffer.width+1
height: iconImageBuffer.height+1 height: mainItemContainer.isSeparator ? parent.height + 1 : iconImageBuffer.height+1
anchors.centerIn: iconGraphic anchors.centerIn: iconGraphic
opacity: 0 opacity: 0
radius: 3 radius: 3
@ -118,10 +118,11 @@ Item{
height: parent.height height: parent.height
Item{ Item{
anchors.rightMargin: iconImageBuffer.rightMargin id:separatorItem
anchors.leftMargin: iconImageBuffer.leftMargin anchors.rightMargin: root.position === PlasmaCore.Types.RightPositioned ? localThickMargin : 0
anchors.bottomMargin: root.position === PlasmaCore.Types.BottomPositioned ? baseMargin : 0 anchors.leftMargin: root.position === PlasmaCore.Types.LeftPositioned ? localThickMargin : 0
anchors.topMargin: iconImageBuffer.topMargin anchors.bottomMargin: root.position === PlasmaCore.Types.BottomPositioned ? localThickMargin : 0
anchors.topMargin: root.position === PlasmaCore.Types.TopPositioned ? localThickMargin : 0
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
@ -130,13 +131,14 @@ Item{
anchors.top: root.position === PlasmaCore.Types.TopPositioned ? parent.top : undefined; anchors.top: root.position === PlasmaCore.Types.TopPositioned ? parent.top : undefined;
anchors.bottom: root.position === PlasmaCore.Types.BottomPositioned ? parent.bottom : undefined; anchors.bottom: root.position === PlasmaCore.Types.BottomPositioned ? parent.bottom : undefined;
property int baseMargin: root.statesLineSize + root.thickMarginBase
opacity: 0.5 opacity: 0.5
visible: mainItemContainer.isSeparator visible: mainItemContainer.isSeparator
width: root.vertical ? iconImageBuffer.width : 5 width: root.vertical ? iconImageBuffer.width : 5
height: !root.vertical ? iconImageBuffer.height : 5 height: !root.vertical ? iconImageBuffer.height : 5
property int localThickMargin: root.thickMarginBase + 4
Rectangle { Rectangle {
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined

Loading…
Cancel
Save