1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-25 19:21:41 +03:00

increase mask thickness when indicators needed it

This commit is contained in:
Michail Vourlakos 2019-02-24 09:24:42 +02:00
parent 35c9550963
commit dd1c3f61b8
3 changed files with 28 additions and 9 deletions

View File

@ -51,22 +51,25 @@ Item{
-thicknessNormal : thicknessNormal;
property int thicknessAutoHidden: Latte.WindowSystem.compositingActive ? 2 : 1
property int thicknessMid: (1 + (0.65 * (root.zoomFactor-1)))*(root.iconSize+root.thickMargins) //needed in some animations
property int thicknessNormal: Math.max(root.iconSize + root.thickMargins +1,
property int thicknessMid: (1 + (0.65 * (root.zoomFactor-1)))*(root.iconSize+root.thickMargins+indicatorsExtraThickMask) //needed in some animations
property int thicknessNormal: Math.max(root.iconSize + root.thickMargins + indicatorsExtraThickMask + 1,
root.realPanelSize + root.panelShadow)
property int thicknessZoom: ((root.iconSize+root.thickMargins) * root.zoomFactor) + 2
property int thicknessZoom: ((root.iconSize+root.thickMargins+indicatorsExtraThickMask) * root.zoomFactor) + 2
//it is used to keep thickness solid e.g. when iconSize changes from auto functions
property int thicknessMidOriginal: Math.max(thicknessNormalOriginal, (1 + (0.65 * (root.zoomFactor-1)))*(root.maxIconSize+root.maxThickMargin)) //needed in some animations
property int thicknessMidOriginal: Math.max(thicknessNormalOriginal,indicatorsExtraThickMask + (1 + (0.65 * (root.zoomFactor-1)))*(root.maxIconSize+root.maxThickMargin)) //needed in some animations
property int thicknessNormalOriginal: !root.behaveAsPlasmaPanel || root.editMode ?
thicknessNormalOriginalValue : root.realPanelSize + root.panelShadow
property int thicknessNormalOriginalValue: root.maxIconSize + (root.maxThickMargin * 2) + 1
property int thicknessZoomOriginal: Math.max( ((root.maxIconSize+(root.maxThickMargin * 2)) * root.zoomFactor) + 2,
property int thicknessNormalOriginalValue: root.maxIconSize + (root.maxThickMargin * 2) + indicatorsExtraThickMask + 1
property int thicknessZoomOriginal: Math.max( ((root.maxIconSize+(root.maxThickMargin * 2)) * root.zoomFactor) + indicatorsExtraThickMask + 2,
root.realPanelSize + root.panelShadow,
thicknessEditMode)
property int thicknessEditMode: thicknessNormalOriginalValue + theme.defaultFont.pixelSize + root.editShadow
//! this is set from indicators when they need extra thickness mask size
property int indicatorsExtraThickMask: 0
Binding{
target: latteView
property:"maxThickness"

View File

@ -570,6 +570,22 @@ Item {
id:unityStyleIndicator
Latte.UnityIndicator{}
}
//! Used when the indicators require more thickness in the view mask
//! e.g. when the Latte indicators are glowing in reverse order
Binding {
target: visibilityManager
property: "indicatorsExtraThickMask"
value: {
if (indicatorLoader.active
&& indicatorLoader.item
&& indicatorLoader.item.hasOwnProperty("extraMaskThickness")) {
return indicatorLoader.item.extraMaskThickness;
}
return 0;
}
}
}
ItemWrapper{

View File

@ -33,7 +33,9 @@ import "../code/ColorizerTools.js" as ColorizerTools
Item{
id: indicatorRoot
property int size: 0.08 * rootItem.iconSize
readonly property int size: 0.08 * rootItem.iconSize
readonly property int extraMaskThickness: rootItem.reversedEnabled && rootItem.glowEnabled ? 1.7 * size : 0
readonly property Item rootItem: parent
property real textColorBrightness: ColorizerTools.colorBrightness(theme.textColor)
@ -47,8 +49,6 @@ Item{
}
property color notActiveColor: rootItem.isMinimized ? minimizedColor : isActiveColor
property Item rootItem: parent
/*Rectangle{
anchors.fill: parent
border.width: 1