update mask value to abilities

pull/21/head
Michail Vourlakos 4 years ago
parent 9f1274bf70
commit 72667f2f57

@ -72,30 +72,20 @@ Item{
}
}
property int finalScreenEdgeMargin: {
//! is used for window geometry calculations
if (!screenEdgeMarginEnabled || hideThickScreenGap) {
/*window geometry is updated after the local screen margin animation was zeroed*/
return 0;
}
return plasmoid.configuration.screenEdgeMargin;
}
property int maxScreenEdgeMargin: root.behaveAsDockWithMask ? Math.max(0, plasmoid.configuration.screenEdgeMargin) : 0
property int thicknessAutoHidden: LatteCore.WindowSystem.compositingActive ? 2 : 1
property int thicknessMid: finalScreenEdgeMargin + (1 + (0.65 * (parabolic.factor.maxZoom-1)))*(metrics.totals.thickness+extraZoomThickMask) //needed in some animations
property int thicknessNormal: finalScreenEdgeMargin + Math.max(metrics.totals.thickness + extraNormalThickMask, background.thickness + background.shadows.headThickness)
property int thicknessMid: metrics.mask.screenEdge + (1 + (0.65 * (parabolic.factor.maxZoom-1)))*(metrics.totals.thickness+extraZoomThickMask) //needed in some animations
property int thicknessNormal: metrics.mask.screenEdge + Math.max(metrics.totals.thickness + extraNormalThickMask, background.thickness + background.shadows.headThickness)
property int thicknessZoom: finalScreenEdgeMargin + ((metrics.totals.thickness+extraZoomThickMask) * parabolic.factor.maxZoom) + 2
property int thicknessZoom: metrics.mask.screenEdge + ((metrics.totals.thickness+extraZoomThickMask) * parabolic.factor.maxZoom) + 2
//it is used to keep thickness solid e.g. when iconSize changes from auto functions
property int thicknessMidOriginal: finalScreenEdgeMargin + Math.max(thicknessNormalOriginal,extraNormalThickMask + (1 + (0.65 * (parabolic.factor.maxZoom-1)))*(metrics.maxIconSize+metrics.margin.maxThickness)) //needed in some animations
property int thicknessNormalOriginal: finalScreenEdgeMargin + metrics.maxIconSize + (metrics.margin.maxThickness * 2) //this way we always have the same thickness published at all states
property int thicknessMidOriginal: metrics.mask.screenEdge + Math.max(thicknessNormalOriginal,extraNormalThickMask + (1 + (0.65 * (parabolic.factor.maxZoom-1)))*(metrics.maxIconSize+metrics.margin.maxThickness)) //needed in some animations
property int thicknessNormalOriginal: metrics.mask.screenEdge + metrics.maxIconSize + (metrics.margin.maxThickness * 2) //this way we always have the same thickness published at all states
/*property int thicknessNormalOriginal: !root.behaveAsPlasmaPanel || root.editMode ?
thicknessNormalOriginalValue : background.thickness + background.shadows.headThickness*/
property int thicknessNormalOriginalValue: finalScreenEdgeMargin + metrics.maxIconSize + (metrics.margin.maxThickness * 2) + extraNormalThickMask
property int thicknessNormalOriginalValue: metrics.mask.screenEdge + metrics.maxIconSize + (metrics.margin.maxThickness * 2) + extraNormalThickMask
property int thicknessZoomOriginal: maxScreenEdgeMargin + Math.max( ((metrics.maxIconSize+(metrics.margin.maxThickness * 2)) * parabolic.factor.maxZoom) + extraZoomThickMask,
background.thickness + background.shadows.headThickness)
@ -769,7 +759,7 @@ Item{
//before updating the localDockGeometry
if (!latteView.behaveAsPlasmaPanel) {
var cleanThickness = metrics.totals.thickness;
var edgeMargin = finalScreenEdgeMargin;
var edgeMargin = metrics.mask.screenEdge;
if (plasmoid.location === PlasmaCore.Types.TopEdge) {
localGeometry.x = latteView.effects.rect.x; // from effects area
@ -823,7 +813,7 @@ Item{
if (!LatteCore.WindowSystem.compositingActive || animated || latteView.behaveAsPlasmaPanel) {
latteView.effects.inputMask = Qt.rect(0, 0, -1, -1);
} else {
var inputThickness = finalScreenEdgeMargin + metrics.totals.thickness;
var inputThickness = metrics.mask.screenEdge + metrics.totals.thickness;
var inputGeometry = Qt.rect(0, 0, root.width, root.height);
if (plasmoid.location === PlasmaCore.Types.TopEdge) {

@ -41,6 +41,12 @@ Ability.MetricsPrivate {
|| root.hideThickScreenGap ?
0 : plasmoid.configuration.screenEdgeMargin
//! used for window geometry calculations
//! window geometry is updated after the local screen margin animation was zeroed*/
mask.screenEdge: (!root.screenEdgeMarginEnabled || root.hideThickScreenGap) ? 0 : plasmoid.configuration.screenEdgeMargin
padding.length: fraction.lengthPadding * iconSize
padding.lengthApplet: fraction.lengthAppletPadding * iconSize
}

@ -29,6 +29,7 @@ AbilityDefinition.Metrics {
backgroundThickness: ref.metrics.backgroundThickness
margin: ref.metrics.margin
mask: ref.metrics.mask
padding: ref.metrics.padding
totals: ref.metrics.totals

@ -30,6 +30,7 @@ AbilityDefinition.Metrics {
readonly property alias backgroundThickness: apis.backgroundThickness
readonly property alias margin: apis.margin
readonly property alias mask: apis.mask
readonly property alias padding: apis.padding
readonly property alias totals: apis.totals
}

@ -29,4 +29,6 @@ Item {
property MetricsTypes.Margin margin: MetricsTypes.Margin{}
property MetricsTypes.Padding padding: MetricsTypes.Padding{}
property MetricsTypes.Totals totals: MetricsTypes.Totals{}
property MetricsTypes.Mask mask: MetricsTypes.Mask{}
}

@ -0,0 +1,24 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
Item {
property int screenEdge: 0
}
Loading…
Cancel
Save