more improvements in shadows and mask calculations

v0.6
Michail Vourlakos 8 years ago
parent a84f19e906
commit 234de12211

@ -421,7 +421,7 @@ Item {
layoutHeight = root.iconSize + moreHeight; layoutHeight = root.iconSize + moreHeight;
} }
else if(applet && applet.pluginName === "org.kde.plasma.systemtray" && root.isHorizontal){ else if(applet && applet.pluginName === "org.kde.plasma.systemtray" && root.isHorizontal){
layoutHeight = root.iconSize+root.iconMargin+root.statesLineSize/2; layoutHeight = root.statesLineSize + root.iconSize;
} }
else{ else{
if(applet && (applet.Layout.minimumHeight > root.iconSize) && root.isVertical && (!canBeHovered)){ if(applet && (applet.Layout.minimumHeight > root.iconSize) && root.isVertical && (!canBeHovered)){
@ -465,7 +465,7 @@ Item {
layoutWidth = root.iconSize + moreWidth; layoutWidth = root.iconSize + moreWidth;
} }
else if(applet && applet.pluginName === "org.kde.plasma.systemtray" && root.isVertical){ else if(applet && applet.pluginName === "org.kde.plasma.systemtray" && root.isVertical){
layoutWidth = root.iconSize+root.iconMargin+root.statesLineSize/2; layoutWidth = root.statesLineSize + root.iconSize;
} }
else{ else{
if(applet && (applet.Layout.minimumWidth > root.iconSize) && root.isHorizontal && (!canBeHovered)){ if(applet && (applet.Layout.minimumWidth > root.iconSize) && root.isHorizontal && (!canBeHovered)){

@ -95,9 +95,9 @@ Item{
opacity: root.useThemePanel ? 1 : 0 opacity: root.useThemePanel ? 1 : 0
visible: (opacity == 0) ? false : true visible: (opacity == 0) ? false : true
property int panelSize: automaticPanelSize + root.panelShadow property int panelSize: automaticPanelSize
property int automaticPanelSize: Math.min(root.themePanelSize, root.iconSize + root.iconMargin + root.statesLineSize/2) property int automaticPanelSize: Math.min(root.themePanelSize + root.panelShadow, root.statesLineSize + root.iconSize + root.iconMargin)
property int shadowsSize: shadowsSvgItem && root.useThemePanel ? property int shadowsSize: shadowsSvgItem && root.useThemePanel ?
(root.isVertical ? shadowsSvgItem.margins.right : shadowsSvgItem.margins.bottom) : 0 (root.isVertical ? shadowsSvgItem.margins.right : shadowsSvgItem.margins.bottom) : 0
@ -117,13 +117,7 @@ Item{
target: root target: root
property: "realPanelSize" property: "realPanelSize"
when: shadowsSvgItem when: shadowsSvgItem
value: { value: shadowsSvgItem.panelSize
var space = ((plasmoid.location === PlasmaCore.Types.BottomEdge) ||
(plasmoid.location === PlasmaCore.Types.TopEdge)) ?
belower.height : belower.width
return shadowsSvgItem.panelSize + space;
}
} }

@ -40,6 +40,7 @@ Item{
property bool inStartup: root.inStartup property bool inStartup: root.inStartup
property bool normalState : false // this is being set from updateMaskArea property bool normalState : false // this is being set from updateMaskArea
property bool previousNormalState : false // this is only for debugging purposes property bool previousNormalState : false // this is only for debugging purposes
property bool panelIsBiggerFromIconSize: root.realPanelSize+root.panelShadow > root.statesLineSize + root.iconSize + root.iconMargin + 1
property int animationSpeed: root.durationTime * 1.2 * units.longDuration property int animationSpeed: root.durationTime * 1.2 * units.longDuration
property int length: root.isVertical ? Screen.height : Screen.width //screenGeometry.height : screenGeometry.width property int length: root.isVertical ? Screen.height : Screen.width //screenGeometry.height : screenGeometry.width
@ -51,14 +52,14 @@ Item{
property int thicknessAutoHidden: 2 property int thicknessAutoHidden: 2
property int thicknessMid: root.statesLineSize + (1 + (0.65 * (root.zoomFactor-1)))*(root.iconSize+root.iconMargin) //needed in some animations property int thicknessMid: root.statesLineSize + (1 + (0.65 * (root.zoomFactor-1)))*(root.iconSize+root.iconMargin) //needed in some animations
property int thicknessNormal: Math.max(root.statesLineSize + root.iconSize + root.iconMargin + root.panelShadow + 1, root.realPanelSize) property int thicknessNormal: Math.max(root.statesLineSize + root.iconSize + root.iconMargin + 1, root.realPanelSize + root.panelShadow)
property int thicknessZoom: root.statesLineSize + ((root.iconSize+root.iconMargin) * root.zoomFactor) + 2 property int thicknessZoom: root.statesLineSize + ((root.iconSize+root.iconMargin) * root.zoomFactor) + 2
//it is used to keep thickness solid e.g. when iconSize changes from auto functions //it is used to keep thickness solid e.g. when iconSize changes from auto functions
property int thicknessMidOriginal: statesLineSizeOriginal + (1 + (0.65 * (root.zoomFactor-1)))*(plasmoid.configuration.iconSize+iconMarginOriginal) //needed in some animations property int thicknessMidOriginal: statesLineSizeOriginal + (1 + (0.65 * (root.zoomFactor-1)))*(plasmoid.configuration.iconSize+iconMarginOriginal) //needed in some animations
property int thicknessNormalOriginal: Math.max(thicknessNormalOriginalValue, root.realPanelSize) property int thicknessNormalOriginal: Math.max(thicknessNormalOriginalValue, root.realPanelSize + root.panelShadow)
property int thicknessNormalOriginalValue: statesLineSizeOriginal + plasmoid.configuration.iconSize + iconMarginOriginal + root.panelShadow + 1 property int thicknessNormalOriginalValue: statesLineSizeOriginal + plasmoid.configuration.iconSize + iconMarginOriginal + 1
property int thicknessZoomOriginal: Math.max(statesLineSizeOriginal + ((plasmoid.configuration.iconSize+iconMarginOriginal) * root.zoomFactor) + root.panelShadow + 2, property int thicknessZoomOriginal: Math.max(statesLineSizeOriginal + ((plasmoid.configuration.iconSize+iconMarginOriginal) * root.zoomFactor) + 2,
root.realPanelSize+root.editShadow) root.realPanelSize + root.panelShadow)
Binding{ Binding{
target: dock target: dock
@ -266,15 +267,17 @@ Item{
//console.log("update mask area:"+newMaskArea); //console.log("update mask area:"+newMaskArea);
if(normalState && !dock.visibility.isHidden){ if(normalState && !dock.visibility.isHidden){
//the shadows size must be removed from the maskArea //the shadows size must be removed from the maskArea
//before updating the localDockGeometry //before updating the localDockGeometry
if(panelIsBiggerFromIconSize) {
var shadow = root.panelShadow; var shadow = root.panelShadow;
if (plasmoid.formFactor === PlasmaCore.Types.Vertical) { if (plasmoid.formFactor === PlasmaCore.Types.Vertical) {
newMaskArea.width = newMaskArea.width - shadow - 1; newMaskArea.width = newMaskArea.width - shadow;
} else { } else {
newMaskArea.height = newMaskArea.height - shadow - 1; newMaskArea.height = newMaskArea.height - shadow;
} }
if (plasmoid.location === PlasmaCore.Types.BottomEdge) { if (plasmoid.location === PlasmaCore.Types.BottomEdge) {
@ -282,6 +285,7 @@ Item{
} else if (plasmoid.location === PlasmaCore.Types.RightEdge) { } else if (plasmoid.location === PlasmaCore.Types.RightEdge) {
newMaskArea.x = newMaskArea.x + shadow; newMaskArea.x = newMaskArea.x + shadow;
} }
}
dock.setLocalDockGeometry(newMaskArea); dock.setLocalDockGeometry(newMaskArea);
// console.log("update dock geometry:"+newMaskArea); // console.log("update dock geometry:"+newMaskArea);

Loading…
Cancel
Save